diff options
author | David Robillard <d@drobilla.net> | 2007-10-03 05:15:09 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-03 05:15:09 +0000 |
commit | 6aa595b3c50dbd409dfd934477c95adff196a807 (patch) | |
tree | 49585e68a7a5cad2d4be4b365b6da956edecb71c /src | |
parent | 008d216a99dc387c234de544bb10de32aa70d175 (diff) | |
download | ingen-6aa595b3c50dbd409dfd934477c95adff196a807.tar.gz ingen-6aa595b3c50dbd409dfd934477c95adff196a807.tar.bz2 ingen-6aa595b3c50dbd409dfd934477c95adff196a807.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/libs/client/Store.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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<ObjectModel> result = (*i).second; - _objects.erase(i); - //cout << "[Store] Removed " << path << endl; + //_objects.erase(i); + Objects::iterator descendants_end = _objects.find_descendants_end(i); + Table<Path,SharedPtr<ObjectModel> > 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(); |