summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-20 22:17:10 +0000
committerDavid Robillard <d@drobilla.net>2007-09-20 22:17:10 +0000
commitc4faafc0d3b9c68d41706ad40edde1ecfb7f4338 (patch)
tree74e73fe18c1c64478a73a9babd4eeb346ca61d66 /src/libs/engine/events
parent615ceaaf519d0c42a9215c4835e1f7348f2e5dca (diff)
downloadingen-c4faafc0d3b9c68d41706ad40edde1ecfb7f4338.tar.gz
ingen-c4faafc0d3b9c68d41706ad40edde1ecfb7f4338.tar.bz2
ingen-c4faafc0d3b9c68d41706ad40edde1ecfb7f4338.zip
Fix deletion of multiple nodes instead of just one (basically fix everything going to hell after deleting a node).
git-svn-id: http://svn.drobilla.net/lad/ingen@743 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/DestroyEvent.cpp14
-rw-r--r--src/libs/engine/events/DestroyEvent.hpp2
2 files changed, 4 insertions, 12 deletions
diff --git a/src/libs/engine/events/DestroyEvent.cpp b/src/libs/engine/events/DestroyEvent.cpp
index 435894bd..ceb75816 100644
--- a/src/libs/engine/events/DestroyEvent.cpp
+++ b/src/libs/engine/events/DestroyEvent.cpp
@@ -40,6 +40,7 @@ DestroyEvent::DestroyEvent(Engine& engine, SharedPtr<Responder> responder, Frame
: QueuedEvent(engine, responder, time, source, source),
_path(path),
_store_iterator(engine.object_store()->objects().end()),
+ _removed_table(NULL),
_node(NULL),
_port(NULL),
_driver_port(NULL),
@@ -74,7 +75,7 @@ DestroyEvent::pre_process()
}
if (_store_iterator != _engine.object_store()->objects().end()) {
- _table = _engine.object_store()->remove(_store_iterator);
+ _removed_table = _engine.object_store()->remove(_store_iterator);
}
if (_node != NULL && _path != "/") {
@@ -86,19 +87,10 @@ DestroyEvent::pre_process()
_disconnect_node_event = new DisconnectNodeEvent(_engine, _node);
_disconnect_node_event->pre_process();
- //_node->remove_from_store();
- _engine.object_store()->remove(_store_iterator);
-
if (_node->parent_patch()->enabled()) {
// FIXME: is this called multiple times?
_compiled_patch = _node->parent_patch()->compile();
- // Remove node to be removed from the process order so it isn't executed by
- // Patch::run and can safely be destroyed
- //for (size_t i=0; i < _compiled_patch->size(); ++i)
- // if (_compiled_patch->at(i) == _node)
- // _compiled_patch->at(i) = NULL; // ew, gap
-
-#ifdef DEBUG
+#ifndef NDEBUG
// Be sure node is removed from process order, so it can be destroyed
for (size_t i=0; i < _compiled_patch->size(); ++i) {
assert(_compiled_patch->at(i).node() != _node);
diff --git a/src/libs/engine/events/DestroyEvent.hpp b/src/libs/engine/events/DestroyEvent.hpp
index ed4328f6..82024e90 100644
--- a/src/libs/engine/events/DestroyEvent.hpp
+++ b/src/libs/engine/events/DestroyEvent.hpp
@@ -61,7 +61,7 @@ public:
private:
Path _path;
ObjectStore::Objects::iterator _store_iterator;
- Table<Path,GraphObject*> _table;
+ Table<Path,GraphObject*> _removed_table;
Node* _node; ///< Same as _object if it is a Node, otherwise NULL
Port* _port; ///< Same as _object if it is a Port, otherwise NULL
DriverPort* _driver_port;