diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-12-30 03:51:00 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-12-30 03:51:00 -0500 |
commit | 2c6d92ec960a7dd70889389e58f6ee84a1e9b0a9 (patch) | |
tree | a55c62320fa232d6c293d20e67fdfda212ad9188 /libs/ardour | |
parent | 75021abfd60b5d25f606518fe0643001cf96fb8c (diff) |
safer housekeeping for control protocol descriptors
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/control_protocol_manager.cc | 10 |
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); |