I think I found the issue.
I'm setting attributes on some vectors.
To do that I create a character vector to hold the attribute value.
This vector is never disposed, so at the final GC, its finalizer is called, probably after the engine handle is closed.
What should be the pattern of disposing vectors?
Can I dispose my vector immediately after setting the attribute value, or will this action lead to some memory being released and then R will have a reference to a dangling pointer for this attribute?
Does R copy the attribute content or does it use the memory allocated by my call?
I'm setting attributes on some vectors.
To do that I create a character vector to hold the attribute value.
This vector is never disposed, so at the final GC, its finalizer is called, probably after the engine handle is closed.
What should be the pattern of disposing vectors?
Can I dispose my vector immediately after setting the attribute value, or will this action lead to some memory being released and then R will have a reference to a dangling pointer for this attribute?
Does R copy the attribute content or does it use the memory allocated by my call?