diff options
author | David Robillard <d@drobilla.net> | 2008-11-16 20:10:32 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-11-16 20:10:32 +0000 |
commit | 24eb14824c9346ca227a7296cb3f620bcf148410 (patch) | |
tree | 99eb4ec5f684e5d8b7a88659d1f81128f27bcb42 /src/gui/PatchCanvas.cpp | |
parent | 77fc40827ed8d713e9cbd8eded2db46aa47ce2d9 (diff) | |
download | ingen-24eb14824c9346ca227a7296cb3f620bcf148410.tar.gz ingen-24eb14824c9346ca227a7296cb3f620bcf148410.tar.bz2 ingen-24eb14824c9346ca227a7296cb3f620bcf148410.zip |
Hide subpatch module ports on destruction (fix ticket #254).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1730 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/PatchCanvas.cpp')
-rw-r--r-- | src/gui/PatchCanvas.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index acbd8efe..0d444ad3 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -379,10 +379,20 @@ PatchCanvas::remove_port(SharedPtr<PortModel> pm) { Views::iterator i = _views.find(pm); + // Port on this patch if (i != _views.end()) { - remove_item(i->second); _views.erase(i); + bool ret = remove_item(i->second); + if (!ret) + cerr << "WARNING: Failed to remove port item: " << pm->path() << endl; + i->second.reset(); + + } else { + SharedPtr<NodeModule> module = PtrCast<NodeModule>(_views[pm->parent()]); + module->remove_port(pm); } + + assert(_views.find(pm) == _views.end()); } |