Cleaning up a singleton
Cleaning up a singleton
- Subject: Cleaning up a singleton
- From: Sebastian Nowicki <email@hidden>
- Date: Sat, 24 May 2008 14:07:10 +0800
Hi,
I have a bit of an odd problem, which may be the result of a bad
design decision. My program wraps around a C library, which internally
uses a global variable (structure) to manage things, and has functions
to access the data. The library requires me to call a function which
allocates memory to that global variable, and afterwards call a
function which deallocates that memory. My singleton class calls the
function to initialise in the init method, but I don't know how to
deallocate the memory. Since singleton objects exist until the end of
program execution, I assume dealloc wouldn't work with garbage
collection. Calling dealloc on a singleton object doesn't even make
sense. How would I handle this?
--
Sebastian Nowicki
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden