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: Sat, 03 Nov 2012 23:45:15 +1100
Hello Jeremy,
On 3/11/2012 8:40 PM, jeremy.sagan wrote:
> I think you should (and I certainly do) unload bundles
OK.
> but because
> bundles may be in use for other plug-in types (VST/AU)
I'm not sure I follow you here. Can you clarify what you mean by "in use
for other plug-in types" please?
> it is important
> (and mandatory on certain plug-ins, e.g. Korg) to do a check on the
> retain count.
Are you suggesting that some plugins retain their own bundle? Would you
be able to give a specific Korg plugin as an example so I can test it?
I'm wondering whether in the code below your app is holding multiple
references to the bundle, or whether you're only holding one and the
other reference(s) are held by the plugin itself.
> Something like this:
>
> CFIndex retainCount = CFGetRetainCount(AHP->piBundle);
> if (retainCount == 1)
> {
> //Do other cleanup here if necessary
> CFBundleUnloadExecutable(AHP->piBundle);
> }
One thing I have noticed is that if you CFRelease a bundle when it's
retain count is 1 it seems to get unloaded anyway.
I.e. releasing the last reference to a bundle automatically triggers
CFBundleUnloadExecutable.
I guess if you want to keep the bundle handle around then calling
CFBundleUnloadExecutable explicitly still makes sense.
Thanks,
Ross.
> -----Original Message----- From: Ross Bencina
> Sent: Saturday, November 03, 2012 3:07 AM
> To: email@hidden API
> Subject: unloading plugin bundles - is it a bad idea?
>
> Hello All,
>
> Does anyone know whether it is usual and advisable for a plugin host to
> unload a plugin's executable bundle after all plugin instances are
> destroyed? In this case plugins include AudioUnit plugins and VST
plugins.
>
> I had been unloading the bundle with CFBundleUnloadExecutable when the
> host was finished with the plugin. However I just came across a plugin
> that crashes when I unload the bundle.
>
> Then I found this thread on Carbon-dev where Chris Hanson says:
>
>> In general, on Mac OS X one should consider bundle/plug-in unloading
>> impossible; one cannot guarantee correctness even if the bundle
>> itself does everything "right," because any underlying framework used
>> by the bundle may not support unloading.
>
> http://lists.apple.com/archives/carbon-dev/2011/Feb/msg00023.html
>
> So I would like to know whether Mac OS X plugin hosts generally don't
> unload plugin bundles.
>
> Thank you,
>
> Ross.
> _______________________________________________
> 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
>
_______________________________________________
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