[Openmcl-devel] cocoa memory management best practices?
Raffael Cavallaro
raffaelcavallaro at mac.com
Fri Sep 24 14:37:52 PDT 2010
On Sep 24, 2010, at 4:42 PM, Gary Byers wrote:
>>
>> 2b. objective-c slot
>> option 1:
>> - call ccl::terminate-when-unreachable on the containing objective-c instance in its intitialize-instance method
>> - do necessary deallocation (#/release, etc.) of objective-c slots in a ccl:terminate method on the containing objective-c class
>> option 2:
>> - do necessary deallocation of objective-c slots in the containing objective-c class's #/dealloc method.
>> option 3 ?:
>> - for objective-c objects owned/managed by a custom window class, do necessary deallocation in the custom window's #/close method
>
> I vote for option 2 (using a #/dealloc method.) Note that (in the
> trunk for the last month or so and as mentioned above) it may be
> necesary to call OBJC:REMOVE-LISP-SLOTS in a #/dealloc method; it's
> harmless to call it if you aren't sure.
Thanks very much for the detailed response - it seems like #/dealloc is the way to go then.
warmest regards,
Ralph
Raffael Cavallaro
raffaelcavallaro at me.com
More information about the Openmcl-devel
mailing list