diff options
author | David Robillard <d@drobilla.net> | 2007-10-10 05:45:04 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-10 05:45:04 +0000 |
commit | c7f3a28390e651e03a68b664086351788a6a2d73 (patch) | |
tree | e4e7037981a876c8e6c69414f6662b0682995212 /src/libs/client | |
parent | 670bf40134c1aa7c1ff175ff8acd9dbed7b9ab41 (diff) | |
download | ingen-c7f3a28390e651e03a68b664086351788a6a2d73.tar.gz ingen-c7f3a28390e651e03a68b664086351788a6a2d73.tar.bz2 ingen-c7f3a28390e651e03a68b664086351788a6a2d73.zip |
Fix recursive patch problems (all objects recursively appearing as direct child of root).
Use slightly more human friendly names for blank nodes in patch files.
Fix memory management semantics of engine side objects (fix crash on subpatch delete).
Make Raul::Table a boost::noncopyable; related changes trickled down from that.
git-svn-id: http://svn.drobilla.net/lad/ingen@865 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/client')
-rw-r--r-- | src/libs/client/ObjectModel.hpp | 2 | ||||
-rw-r--r-- | src/libs/client/Store.cpp | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/libs/client/ObjectModel.hpp b/src/libs/client/ObjectModel.hpp index f9be4fa6..586ef8b3 100644 --- a/src/libs/client/ObjectModel.hpp +++ b/src/libs/client/ObjectModel.hpp @@ -68,6 +68,8 @@ public: const string name() const { return _path.name(); } SharedPtr<ObjectModel> parent() const { return _parent; } bool polyphonic() const { return _polyphonic; } + + GraphObject* graph_parent() const { return _parent.get(); } const_iterator children_begin() const; const_iterator children_end() const; diff --git a/src/libs/client/Store.cpp b/src/libs/client/Store.cpp index ab2ea280..b118b4e4 100644 --- a/src/libs/client/Store.cpp +++ b/src/libs/client/Store.cpp @@ -272,7 +272,9 @@ Store::remove_object(const Path& path) assert(result); //_objects.erase(i); Objects::iterator descendants_end = _objects.find_descendants_end(i); - Table<Path, SharedPtr<Shared::GraphObject> > removed = _objects.yank(i, descendants_end); + SharedPtr< Table<Path, SharedPtr<Shared::GraphObject> > > 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; @@ -365,11 +367,12 @@ Store::rename_event(const Path& old_path, const Path& new_path) Objects::iterator descendants_end = _objects.find_descendants_end(parent); - Table<Path, SharedPtr<Shared::GraphObject> > removed = _objects.yank(parent, descendants_end); + SharedPtr< Table<Path, SharedPtr<Shared::GraphObject> > > removed + = _objects.yank(parent, descendants_end); - assert(removed.size() > 0); + assert(removed->size() > 0); - for (Table<Path, SharedPtr<Shared::GraphObject> >::iterator i = removed.begin(); i != removed.end(); ++i) { + for (Table<Path, SharedPtr<Shared::GraphObject> >::iterator i = removed->begin(); i != removed->end(); ++i) { const Path& child_old_path = i->first; assert(Path::descendant_comparator(old_path, child_old_path)); @@ -384,7 +387,7 @@ Store::rename_event(const Path& old_path, const Path& new_path) i->first = child_new_path; } - _objects.cram(removed); + _objects.cram(*removed.get()); //cerr << "[Store] Table:" << endl; //for (size_t i=0; i < removed.size(); ++i) { @@ -482,7 +485,8 @@ Store::patch_cleared_event(const Path& path) SharedPtr<PatchModel> patch = PtrCast<PatchModel>(object(path)); if (patch) for (ObjectModel::const_iterator i = patch->children_begin(); i != patch->children_end(); ++i) - destruction_event(i->second->path()); + if (i->second->graph_parent() == patch.get()) + destruction_event(i->second->path()); } |