LanguageLink, Lifetimes, and Garbage Collection
Remote LanguageLink implementation have, by design, no visibility into Glamorous Toolkit or Lepiter. As such, they cannot know about the lifetimes of values or when to free them.
To mitigate this, LanguageLink remote objects should be tagged with an ID and entered into a LanguageLinkExecutionHandler
using LanguageLinkExecutionHandler>>#registerObject:
. This will register a finalizer that will call LanguageLinkExecutionHandler>>#removeId:
when the object is finalized, giving the remote implementation a chance to remove the object from its own registry and destroy it or free it for garbage collection.
Note that, to avoid infinite GC loops, the object returned from this remote message should not also be electable for garbage collection itself.