From 0a9297ed2a1622d252a389d8babc0656fedbe7fd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 15 Aug 2012 04:18:31 +0000 Subject: Simpler and more unified EnginePort implementation. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4699 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/events/Delete.cpp | 10 ++++------ src/server/events/Delete.hpp | 1 - src/server/events/Disconnect.hpp | 1 - src/server/events/Move.cpp | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) (limited to 'src/server/events') diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp index 97f1161f..84b29a6f 100644 --- a/src/server/events/Delete.cpp +++ b/src/server/events/Delete.cpp @@ -41,7 +41,6 @@ Delete::Delete(Engine& engine, const Raul::URI& uri) : Event(engine, client, id, time) , _uri(uri) - , _garbage(NULL) , _engine_port(NULL) , _patch_node_listnode(NULL) , _patch_port_listnode(NULL) @@ -111,7 +110,7 @@ Delete::pre_process() } if (!_port->parent_patch()->parent()) { - _engine_port = _engine.driver()->port(_port->path()); + _engine_port = _engine.driver()->get_port(_port->path()); } } @@ -145,7 +144,7 @@ Delete::execute(ProcessContext& context) _port->parent_patch()->external_ports(_ports_array); if (_engine_port) { - _garbage = _engine.driver()->remove_port(context, _engine_port); + _engine.driver()->remove_port(context, _engine_port); } } @@ -177,10 +176,9 @@ Delete::post_process() } if (_engine_port) { - _engine_port->destroy(); + _engine.driver()->unregister_port(*_engine_port); + delete _engine_port; } - - delete _garbage; } } // namespace Events diff --git a/src/server/events/Delete.hpp b/src/server/events/Delete.hpp index 53671846..a493fcf7 100644 --- a/src/server/events/Delete.hpp +++ b/src/server/events/Delete.hpp @@ -73,7 +73,6 @@ private: Raul::Path _path; SharedPtr _node; ///< Non-NULL iff a node SharedPtr _port; ///< Non-NULL iff a port - Raul::Deletable* _garbage; EnginePort* _engine_port; PatchImpl::Nodes::Node* _patch_node_listnode; Raul::List::Node* _patch_port_listnode; diff --git a/src/server/events/Disconnect.hpp b/src/server/events/Disconnect.hpp index bcd8f1bc..b008025a 100644 --- a/src/server/events/Disconnect.hpp +++ b/src/server/events/Disconnect.hpp @@ -24,7 +24,6 @@ #include "BufferFactory.hpp" namespace Raul { -template class ListNode; template class Array; } diff --git a/src/server/events/Move.cpp b/src/server/events/Move.cpp index 4d72e9ba..5fa58825 100644 --- a/src/server/events/Move.cpp +++ b/src/server/events/Move.cpp @@ -65,7 +65,7 @@ Move::pre_process() return Event::pre_process_done(EXISTS, _new_path); } - EnginePort* eport = _engine.driver()->port(_old_path); + EnginePort* eport = _engine.driver()->get_port(_old_path); if (eport) { _engine.driver()->rename_port(_old_path, _new_path); } -- cgit v1.2.1