Re: Bundle loading
Re: Bundle loading
- Subject: Re: Bundle loading
- From: Ondra Cada <email@hidden>
- Date: Thu, 22 Aug 2002 22:50:35 +0200
On Thursday, August 22, 2002, at 07:00 , Chris Ridd wrote:
Marco was alluding to problems with +load earlier.
+load is needed seldom enough. Unless you need some classes to poseAs
their superclasses, or unless you need your bundle which is not supported
by the application which loads it to initialize anyway, there is hardly
any reason for it.
I can probably avoid using it, and instead arrange for initialization of
whatever object network I need in the (small number of) entry points in my
bundle. That shouldn't be too much of a hassle.
If it is really so, the +initialize someone already has mentioned might be
your real friend.
However what happens when the host exits? Do my objects get sent the
-dealloc message when the host (a CFM app in my case) exits and my bundle
gets "unloaded"?
Alas here. Your bundle never gets unloaded, and no objects gets
deallocated when app exits. Just the complete task memory gets freed, but
its contents is never checked.
In Cocoa app, the proper place for exit cleanup is the
NSApplicationWillTerminateNotification notification (or the appropriate
delegate method, if any). For non-Cocoa apps, I'd guess the standard
atexit (man atexit) is the way.
Of course if the application is killed the hard way, there's no way to do
any cleanup at all (and I guess that's right).
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.