diff options
author | David Robillard <d@drobilla.net> | 2011-01-06 00:29:28 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-06 00:29:28 +0000 |
commit | 352664583e87761925edda23f8bd9a9fe1777fe6 (patch) | |
tree | cc39d6385b9d140d00ec926294005730dffe1560 /src/PatchageEvent.cpp | |
parent | d1e4ea99369351b6b3a44ad0c3da2afd857db960 (diff) | |
download | patchage-352664583e87761925edda23f8bd9a9fe1777fe6.tar.gz patchage-352664583e87761925edda23f8bd9a9fe1777fe6.tar.bz2 patchage-352664583e87761925edda23f8bd9a9fe1777fe6.zip |
Clean up port cache (fix crashes and wacky behaviour caused when clients/ports are repeatedly created and destroyed).
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@2787 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/PatchageEvent.cpp')
-rw-r--r-- | src/PatchageEvent.cpp | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/PatchageEvent.cpp b/src/PatchageEvent.cpp index 5b27726..dffbff3 100644 --- a/src/PatchageEvent.cpp +++ b/src/PatchageEvent.cpp @@ -53,8 +53,6 @@ PatchageEvent::execute(Patchage* patchage) if (module) { patchage->canvas()->remove_item(module); module.reset(); - } else { - Raul::error << "Unable to find client `" << _str << "' to remove" << endl; } free(_str); @@ -85,23 +83,9 @@ PatchageEvent::execute(Patchage* patchage) } else if (_type == PORT_DESTRUCTION) { - SharedPtr<PatchagePort> port = patchage->canvas()->find_port(_port_1); - + SharedPtr<PatchagePort> port = patchage->canvas()->remove_port(_port_1); if (port) { - SharedPtr<PatchageModule> module = PtrCast<PatchageModule>(port->module().lock()); - assert(module); - - module->remove_port(port); port.reset(); - - // No empty modules (for now) - if (module->num_ports() == 0) { - patchage->canvas()->remove_item(module); - module.reset(); - } else { - patchage->enqueue_resize(module); - } - } else { Raul::error << "Unable to find port `" << _port_1 << "' to destroy" << endl; } |