summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/control_protocol_manager.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc
index b97c89b809..3856743e70 100644
--- a/libs/ardour/control_protocol_manager.cc
+++ b/libs/ardour/control_protocol_manager.cc
@@ -223,10 +223,16 @@ ControlProtocolManager::teardown (ControlProtocolInfo& cpi)
}
cpi.protocol = 0;
+
delete cpi.state;
cpi.state = 0;
- delete (Glib::Module*)cpi.descriptor->module;
- cpi.descriptor->module = 0;
+
+ 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
+ * object made accessible by dlopen().
+ */
+ cpi.descriptor = 0;
ProtocolStatusChange (&cpi);