summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-12-21 06:22:49 +0000
committerDavid Robillard <d@drobilla.net>2012-12-21 06:22:49 +0000
commit7c8166d2eab084fe4abdc0bf4045641a2809e4f9 (patch)
tree1c269a9f666500980ea00cec22a9debf4e174be8 /src/server
parentf67344b4c6c7df01dd1e9f3023fa20416103cb6a (diff)
downloadingen-7c8166d2eab084fe4abdc0bf4045641a2809e4f9.tar.gz
ingen-7c8166d2eab084fe4abdc0bf4045641a2809e4f9.tar.bz2
ingen-7c8166d2eab084fe4abdc0bf4045641a2809e4f9.zip
Fix memory leaks.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4873 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server')
-rw-r--r--src/server/Engine.cpp6
-rw-r--r--src/server/JackDriver.cpp5
-rw-r--r--src/server/Worker.cpp3
3 files changed, 14 insertions, 0 deletions
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index 7e1e2ffc..9bcc9163 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -79,6 +79,7 @@ Engine::Engine(Ingen::World* world)
Engine::~Engine()
{
+ _root_graph = NULL;
deactivate();
const SharedPtr<Store> s = this->store();
@@ -99,6 +100,11 @@ Engine::~Engine()
delete _control_bindings;
delete _broadcaster;
delete _event_writer;
+ delete _worker;
+
+ _driver.reset();
+
+ delete _buffer_factory;
munlockall();
}
diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp
index ac3393a2..fd6b2631 100644
--- a/src/server/JackDriver.cpp
+++ b/src/server/JackDriver.cpp
@@ -66,9 +66,14 @@ JackDriver::JackDriver(Engine& engine)
&_forge, &engine.world()->uri_map().urid_map_feature()->urid_map);
}
+struct PortDisposer {
+ void operator()(EnginePort* port) { delete port; }
+};
+
JackDriver::~JackDriver()
{
deactivate();
+ _ports.clear_and_dispose(PortDisposer());
if (_client)
jack_client_close(_client);
diff --git a/src/server/Worker.cpp b/src/server/Worker.cpp
index 68300a16..5bf20609 100644
--- a/src/server/Worker.cpp
+++ b/src/server/Worker.cpp
@@ -115,6 +115,9 @@ Worker::Worker(Log& log, uint32_t buffer_size)
Worker::~Worker()
{
+ _exit_flag = true;
+ _sem.post();
+ join();
free(_buffer);
}