Re: Bundle loading
Re: Bundle loading
- Subject: Re: Bundle loading
- From: Chris Ridd <email@hidden>
- Date: Thu, 22 Aug 2002 18:00:49 +0100
On 22/8/02 5:44 pm, Douglas Davidson <email@hidden> wrote:
>
>
On Thursday, August 22, 2002, at 05:03 AM, Chris Ridd wrote:
>
>
> Does loading a bundle in cause any code to get executed in the bundle
>
> automatically, or any other kind of automatic initialization?
>
>
>
> Basically if I write a bundle, how do I make sure that some kind of
>
> initialization that I may require happens?
>
>
>
> The docs are pretty unclear on this, as they seem to be mostly written
>
> from
>
> the point of view of the code loading the bundle in.
>
>
A bundle can contain any of a number of different types of
>
executables--for example, an application bundle can contain a Mach-o or
>
PEF executable, a framework bundle contains a Mach-o MH_DYLIB, a
>
loadable bundle can contain a Mach-o MH_BUNDLE or a loadable PEF
>
executable. The semantics of bundle loading depend on the type of
>
executable. Some types of executables, such as application main
>
executables, cannot be dynamically loaded at all. For those
>
executables that can be loaded, the behavior at load time depends on
>
the behavior of the underlying runtime. This in turn may vary
>
depending on the type of executable--for example, both Mach-o MH_DYLIBs
>
and MH_BUNDLEs can be loaded, but they have somewhat different
>
semantics at load time. Please look at the runtime architecture
>
documentation for more information.
Thanks, I have grabbed the August version of this from your web site.
>
That said, I would like to make a strong recommendation against
>
load-time execution of code, if it can be at all avoided. Mac OS X and
Marco was alluding to problems with +load earlier.
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.
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"?
Cheers,
Chris
_______________________________________________
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.