diff options
author | Sampo Savolainen <v2@iki.fi> | 2006-11-12 22:50:21 +0000 |
---|---|---|
committer | Sampo Savolainen <v2@iki.fi> | 2006-11-12 22:50:21 +0000 |
commit | 75c3b147f1f68673054bfb470f48e89fbe90d8c8 (patch) | |
tree | dc0cc9dc2cda8e2546ab7402786dfd143538b449 /libs/ardour/control_protocol_manager.cc | |
parent | 638336eee5c7ce79faa526f2890634dc82785d62 (diff) |
Make sure ControlProtocolInfo objects are also cleaned up when
disconnecting from a session.
git-svn-id: svn://localhost/ardour2/trunk@1118 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/control_protocol_manager.cc')
-rw-r--r-- | libs/ardour/control_protocol_manager.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/libs/ardour/control_protocol_manager.cc b/libs/ardour/control_protocol_manager.cc index 1ff6c28ef3..a715254747 100644 --- a/libs/ardour/control_protocol_manager.cc +++ b/libs/ardour/control_protocol_manager.cc @@ -36,6 +36,13 @@ ControlProtocolManager::~ControlProtocolManager() } control_protocols.clear (); + + + for (list<ControlProtocolInfo*>::iterator p = control_protocol_info.begin(); p != control_protocol_info.end(); ++p) { + delete (*p); + } + + control_protocol_info.clear(); } @@ -68,6 +75,12 @@ ControlProtocolManager::drop_session () delete *p; } control_protocols.clear (); + + for (list<ControlProtocolInfo*>::iterator p = control_protocol_info.begin(); p != control_protocol_info.end(); ++p) { + delete *p; + } + + control_protocol_info.clear(); } } @@ -122,6 +135,15 @@ ControlProtocolManager::teardown (ControlProtocolInfo& cpi) list<ControlProtocol*>::iterator p = find (control_protocols.begin(), control_protocols.end(), cpi.protocol); if (p != control_protocols.end()) { control_protocols.erase (p); + } else { + cerr << "Programming error: ControlProtocolManager::teardown() called for " << cpi.name << ", but it was not found in control_protocols" << endl; + } + + list<ControlProtocolInfo*>::iterator p2 = find (control_protocol_info.begin(), control_protocol_info.end(), &cpi); + if (p2 != control_protocol_info.end()) { + control_protocol_info.erase (p2); + } else { + cerr << "Programming error: ControlProtocolManager::teardown() called for " << cpi.name << ", but it was not found in control_protocol_info" << endl; } } |