From 6aa595b3c50dbd409dfd934477c95adff196a807 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 3 Oct 2007 05:15:09 +0000 Subject: Fix (recursive) destruction of objects on client side (fixes bug where creating a node, deleting it, and recreating it with the same name would result in a node with no ports). git-svn-id: http://svn.drobilla.net/lad/ingen@803 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/Store.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/libs/client') diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index b399505d..2838ca12 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -275,8 +275,14 @@ Store::remove_object(const Path& path) if (i != _objects.end()) { assert((*i).second->path() == path); SharedPtr result = (*i).second; - _objects.erase(i); - //cout << "[Store] Removed " << path << endl; + //_objects.erase(i); + Objects::iterator descendants_end = _objects.find_descendants_end(i); + Table > removed = _objects.yank(i, descendants_end); + /*cout << "[Store] Removing " << i->first << " {" << endl; + for (Objects::iterator i = removed.begin(); i != removed.end(); ++i) { + cout << "\t" << i->first << endl; + } + cout << "}" << endl;*/ if (result) result->signal_destroyed.emit(); -- cgit v1.2.1