mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 13:46:30 +01:00
possible extra housekeeping for control protocol modules.
Currently this code isn't reached because we never call ControlProtocolManager::teardown() on inactive protocols. But at some point it might be appropriate to unload modules (.so/.dll/.dylib) even if the protocol was never instantiated
This commit is contained in:
parent
2c6d92ec96
commit
b390d8c8a6
1 changed files with 13 additions and 1 deletions
|
|
@ -193,6 +193,18 @@ int
|
|||
ControlProtocolManager::teardown (ControlProtocolInfo& cpi)
|
||||
{
|
||||
if (!cpi.protocol) {
|
||||
|
||||
/* we could still have a descriptor even if the protocol was
|
||||
never instantiated. Close the associated module (shared
|
||||
object/DLL) and make sure we forget about it.
|
||||
*/
|
||||
|
||||
if (cpi.descriptor) {
|
||||
cerr << "Closing descriptor for CPI anyway\n";
|
||||
delete (Glib::Module*) cpi.descriptor->module;
|
||||
cpi.descriptor = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -226,7 +238,7 @@ ControlProtocolManager::teardown (ControlProtocolInfo& cpi)
|
|||
|
||||
delete cpi.state;
|
||||
cpi.state = 0;
|
||||
|
||||
cerr << "Tear down CPI module for " << cpi.name << endl;
|
||||
delete (Glib::Module*) cpi.descriptor->module;
|
||||
/* cpi->descriptor is now inaccessible since dlclose() or equivalent
|
||||
* has been performed, and the descriptor is (or could be) a static
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue