diff options
Diffstat (limited to 'libs/ardour/control_protocol_manager.cc')
-rw-r--r-- | libs/ardour/control_protocol_manager.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc index 3856743e70..c042e4f0c0 100644 --- a/libs/ardour/control_protocol_manager.cc +++ b/libs/ardour/control_protocol_manager.cc @@ -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 |