* When an Obj-C object is garbage collected in Squeak, is the release propagated back to Obj-C (does it even have to be)?
* Is it safe to autorelease objects? What is the "event loop" of obj-c code called from Squeak?
* If objects become zombies, how long do they hang around? Are they finally destroyed when I quit the image?
Objective-C objects which get GCed get dealloc messages, there is no
way to feed that back to Squeak.
When a Smalltalk object gets GCed you should setup a weak relationship
so that on the finalization action you could then send release to the
companion Objective-C object.
I never did this as it is tricky, difficult and nasty when it goes
wrong. Still you might be lucky when you implement it, you'll find
working examples in the image.
Look for use of the autorelease pool in the objective-c bridge.
The event loop runs each time you call the get next primitive, so
making an auto-released object without a pool would cause the object
to be released at an undetermined time.
Zombies are of course released when a unix process, aka os-x
application, ios app terminates. All resources are returned for reuse
by other users.
As an exercise think about the asUTF8String and what happens, welcome
to managed memory allocation.
Oh yes a finalization solution work work fine for this case.
On Sun, May 1, 2011 at 10:38 PM, Sean P. DeNigris <[hidden email]> wrote: