From 2a525cc1aa5396f12f7b8fdaf3e8ea11cbe25247 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 31 Oct 2009 23:59:57 +0000 Subject: Remove connections in the GUI before ports, preventing missed lookups. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2209 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/PatchModel.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp index cec8b13b..25255f06 100644 --- a/src/client/PatchModel.cpp +++ b/src/client/PatchModel.cpp @@ -52,14 +52,9 @@ PatchModel::remove_child(SharedPtr o) assert(o->path().is_child_of(_path)); assert(o->parent().get() == this); - SharedPtr pm = PtrCast(o); - if (pm) - remove_port(pm); - // Remove any connections which referred to this object, // since they can't possibly exist anymore - for (Connections::iterator j = _connections->begin(); j != _connections->end() ; ) { - + for (Connections::iterator j = _connections->begin(); j != _connections->end(); ) { Connections::iterator next = j; ++next; @@ -77,6 +72,10 @@ PatchModel::remove_child(SharedPtr o) j = next; } + SharedPtr pm = PtrCast(o); + if (pm) + remove_port(pm); + SharedPtr nm = PtrCast(o); if (nm) signal_removed_node.emit(nm); -- cgit v1.2.1