summaryrefslogtreecommitdiffstats
path: root/src/engine/events/DestroyEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-12-20 20:28:04 +0000
committerDavid Robillard <d@drobilla.net>2008-12-20 20:28:04 +0000
commit76f6fcfad68d88728bb1a04b193029aa9e46e976 (patch)
tree271ca830393f9b6dc5241b1ff152905902aaeced /src/engine/events/DestroyEvent.cpp
parent72c6d069df26396436c653532702a4f96f901fba (diff)
downloadingen-76f6fcfad68d88728bb1a04b193029aa9e46e976.tar.gz
ingen-76f6fcfad68d88728bb1a04b193029aa9e46e976.tar.bz2
ingen-76f6fcfad68d88728bb1a04b193029aa9e46e976.zip
Fix deregistration of Jack ports, associated memory leaks. Hopefully a fix for #294 and #305).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1877 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/events/DestroyEvent.cpp')
-rw-r--r--src/engine/events/DestroyEvent.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/engine/events/DestroyEvent.cpp b/src/engine/events/DestroyEvent.cpp
index c1ee15e7..52c19945 100644
--- a/src/engine/events/DestroyEvent.cpp
+++ b/src/engine/events/DestroyEvent.cpp
@@ -128,6 +128,7 @@ DestroyEvent::execute(ProcessContext& context)
if (_node->parent_patch()->compiled_patch())
_engine.maid()->push(_node->parent_patch()->compiled_patch());
+
_node->parent_patch()->compiled_patch(_compiled_patch);
} else if (_patch_port_listnode) {
@@ -151,6 +152,10 @@ DestroyEvent::execute(ProcessContext& context)
_driver_port = _engine.audio_driver()->remove_port(_port->path());
else if (_port->type() == DataType::EVENT)
_driver_port = _engine.midi_driver()->remove_port(_port->path());
+
+ // Apparently this needs to be called in post_process??
+ //if (_driver_port)
+ // _driver_port->elem()->unregister();
}
}
@@ -194,7 +199,10 @@ DestroyEvent::post_process()
_responder->respond_error("Unable to destroy object");
}
- delete _driver_port;
+ if (_driver_port) {
+ _driver_port->elem()->unregister();
+ _engine.maid()->push(_driver_port);
+ }
}