summaryrefslogtreecommitdiffstats
path: root/src/engine/events
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-01-29 04:35:48 +0000
committerDavid Robillard <d@drobilla.net>2010-01-29 04:35:48 +0000
commit96613df7830699dbbfb5c2d9fe3ebdb0598e6aca (patch)
treebb7278466fc9ae92be6b53fb2f6399754d15f842 /src/engine/events
parent1b964e850bbe3207fe9a65849520634955d141f0 (diff)
downloadingen-96613df7830699dbbfb5c2d9fe3ebdb0598e6aca.tar.gz
ingen-96613df7830699dbbfb5c2d9fe3ebdb0598e6aca.tar.bz2
ingen-96613df7830699dbbfb5c2d9fe3ebdb0598e6aca.zip
Remove references to deleted ports with control bindings (fix crash when applying binding to deleted port).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2393 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/events')
-rw-r--r--src/engine/events/Delete.cpp25
-rw-r--r--src/engine/events/Delete.hpp3
2 files changed, 16 insertions, 12 deletions
diff --git a/src/engine/events/Delete.cpp b/src/engine/events/Delete.cpp
index 956253d6..11d355a4 100644
--- a/src/engine/events/Delete.cpp
+++ b/src/engine/events/Delete.cpp
@@ -17,18 +17,19 @@
#include "raul/Maid.hpp"
#include "raul/Path.hpp"
+#include "ClientBroadcaster.hpp"
+#include "ControlBindings.hpp"
#include "Delete.hpp"
-#include "Responder.hpp"
-#include "Engine.hpp"
-#include "PatchImpl.hpp"
-#include "NodeBase.hpp"
-#include "PluginImpl.hpp"
-#include "Driver.hpp"
#include "DisconnectAll.hpp"
-#include "ClientBroadcaster.hpp"
+#include "Driver.hpp"
+#include "Engine.hpp"
#include "EngineStore.hpp"
#include "EventSource.hpp"
+#include "NodeBase.hpp"
+#include "PatchImpl.hpp"
+#include "PluginImpl.hpp"
#include "PortImpl.hpp"
+#include "Responder.hpp"
using namespace std;
@@ -62,6 +63,8 @@ Delete::~Delete()
void
Delete::pre_process()
{
+ _removed_bindings = _engine.control_bindings()->remove(_path);
+
_store_iterator = _engine.engine_store()->find(_path);
if (_store_iterator != _engine.engine_store()->end()) {
@@ -75,7 +78,7 @@ Delete::pre_process()
_removed_table = _engine.engine_store()->remove(_store_iterator);
}
- if (_node != NULL && !_path.is_root()) {
+ if (_node && !_path.is_root()) {
assert(_node->parent_patch());
_patch_node_listnode = _node->parent_patch()->remove_node(_path.name());
if (_patch_node_listnode) {
@@ -153,10 +156,6 @@ Delete::execute(ProcessContext& context)
if ( ! _port->parent_patch()->parent()) {
_driver_port = _engine.driver()->remove_port(_port->path());
-
- // Apparently this needs to be called in post_process??
- //if (_driver_port)
- // _driver_port->elem()->unregister();
}
}
@@ -168,6 +167,8 @@ Delete::execute(ProcessContext& context)
void
Delete::post_process()
{
+ _removed_bindings.reset();
+
if (!_node && !_port) {
if (_path.is_root()) {
_responder->respond_error("You can not destroy the root patch (/)");
diff --git a/src/engine/events/Delete.hpp b/src/engine/events/Delete.hpp
index ac46030f..e4cb6732 100644
--- a/src/engine/events/Delete.hpp
+++ b/src/engine/events/Delete.hpp
@@ -21,6 +21,7 @@
#include "QueuedEvent.hpp"
#include "EngineStore.hpp"
#include "PatchImpl.hpp"
+#include "ControlBindings.hpp"
namespace Raul {
template<typename T> class Array;
@@ -82,6 +83,8 @@ private:
CompiledPatch* _compiled_patch; ///< Patch's new process order
DisconnectAll* _disconnect_event;
+ SharedPtr<ControlBindings::Bindings> _removed_bindings;
+
SharedPtr< Raul::Table<Raul::Path, SharedPtr<Shared::GraphObject> > > _removed_table;
};