diff options
-rw-r--r-- | src/engine/events/ClearPatchEvent.cpp | 18 | ||||
-rw-r--r-- | src/engine/events/ClearPatchEvent.hpp | 2 |
2 files changed, 16 insertions, 4 deletions
diff --git a/src/engine/events/ClearPatchEvent.cpp b/src/engine/events/ClearPatchEvent.cpp index ccb84d48..3a016a66 100644 --- a/src/engine/events/ClearPatchEvent.cpp +++ b/src/engine/events/ClearPatchEvent.cpp @@ -74,6 +74,10 @@ ClearPatchEvent::pre_process() SharedPtr<PortImpl> port = PtrCast<PortImpl>(i->second); if (port) ++port_count; + + SharedPtr<NodeImpl> node = PtrCast<NodeImpl>(i->second); + if (node) + node->deactivate(); } _driver_ports = new DriverPorts(port_count, NULL); @@ -139,9 +143,13 @@ ClearPatchEvent::post_process() assert(_patch->num_ports() == 0); assert(_patch->connections().size() == 0); - // Reply - _responder->respond_ok(); - _engine.broadcaster()->send_clear_patch(_patch_path); + // Deactivate nodes + for (EngineStore::Objects::iterator i = _removed_table->begin(); + i != _removed_table->end(); ++i) { + SharedPtr<NodeImpl> node = PtrCast<NodeImpl>(i->second); + if (node) + node->deactivate(); + } // Unregister and destroy driver ports if (_driver_ports) { @@ -155,6 +163,10 @@ ClearPatchEvent::post_process() delete _driver_ports; } + // Reply + _responder->respond_ok(); + _engine.broadcaster()->send_clear_patch(_patch_path); + } else { _responder->respond_error(string("Patch ") + _patch_path.str() + " not found"); } diff --git a/src/engine/events/ClearPatchEvent.hpp b/src/engine/events/ClearPatchEvent.hpp index e121c423..4dc7dddb 100644 --- a/src/engine/events/ClearPatchEvent.hpp +++ b/src/engine/events/ClearPatchEvent.hpp @@ -54,7 +54,7 @@ private: typedef Raul::Array<Raul::List<DriverPort*>::Node*> DriverPorts; DriverPorts* _driver_ports; - SharedPtr< Raul::Table<Raul::Path, SharedPtr<Shared::GraphObject> > > _removed_table; + SharedPtr<EngineStore::Objects> _removed_table; }; |