From 3ffc448198c364224d04db006abd843716adf32f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 14 May 2012 04:37:49 +0000 Subject: Factor out common code. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4406 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/events/Delete.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/server/events') diff --git a/src/server/events/Delete.cpp b/src/server/events/Delete.cpp index 95e63d4d..6d2703b9 100644 --- a/src/server/events/Delete.cpp +++ b/src/server/events/Delete.cpp @@ -175,25 +175,21 @@ Delete::post_process() // XXX: Report error? Silently ignore? } else if (!_node && !_port) { respond(NOT_FOUND); - } else if (_patch_node_listnode) { - assert(_node); - _node->deactivate(); - respond(SUCCESS); - _engine.broadcaster()->bundle_begin(); - if (_disconnect_event) - _disconnect_event->post_process(); - _engine.broadcaster()->del(_path); - _engine.broadcaster()->bundle_end(); - _engine.maid()->push(_patch_node_listnode); - } else if (_patch_port_listnode) { - assert(_port); + } else if (_patch_node_listnode || _patch_port_listnode) { + if (_patch_node_listnode) { + _node->deactivate(); + _engine.maid()->push(_patch_node_listnode); + } else if (_patch_port_listnode) { + _engine.maid()->push(_patch_port_listnode); + } + respond(SUCCESS); _engine.broadcaster()->bundle_begin(); - if (_disconnect_event) + if (_disconnect_event) { _disconnect_event->post_process(); + } _engine.broadcaster()->del(_path); _engine.broadcaster()->bundle_end(); - _engine.maid()->push(_patch_port_listnode); } else { respond(FAILURE); } -- cgit v1.2.1