Re: unloading plugin bundles - is it a bad idea?
Re: unloading plugin bundles - is it a bad idea?
- Subject: Re: unloading plugin bundles - is it a bad idea?
- From: Ross Bencina <email@hidden>
- Date: Sun, 04 Nov 2012 11:11:31 +1100
Thanks Paul and Jeremy,
That all makes sense now.
None the less the plugin in question is still crashing even though my
host holds the only reference before unloading it. The plugin works fine
in the other hosts I have tested, and seems likely to be somewhat widely
tested, which suggests:
A. Many hosts don't unload plugin bundles
and/or
B. I have another bug
I rather suspect (A) since my limited testing suggests other hosts dont'
unload bundles. AULab doesn't seem to, for example.
You can check whether a bundle is loaded with vmmap:
% vmmap partOfHostProcessName | grep partOfBundleName
I don't want to out the plugin here but if anyone is willing to try it
in their host to see if it crashes I can send you a link privately. It's
a free plugin.
Thanks,
Ross
On 4/11/2012 12:13 AM, Paul Davis wrote:
https://developer.apple.com/library/mac/#documentation/CoreFOundation/Reference/CFBundleRef/Reference/reference.html
------------------------
|CFBundleGetFunctionPointerForName
<https://developer.apple.com/library/mac/documentation/CoreFOundation/Reference/CFBundleRef/Reference/reference.html#//apple_ref/c/func/CFBundleGetFunctionPointerForName>|
and related calls automatically load a bundle if it is not already
loaded. When the last reference to the CFBundle object is released and
it is finally deallocated, then the code will be unloaded if it is still
loaded and if the executable is of a type that supports unloading. If
you keep this in mind, and if you make sure that everything that uses
the bundle keeps a retain on the CFBundle object, then you can just use
the bundle naturally and never have to worry about when it is loaded and
unloaded.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden