diff options
author | David Robillard <d@drobilla.net> | 2012-12-21 06:22:49 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-12-21 06:22:49 +0000 |
commit | 7c8166d2eab084fe4abdc0bf4045641a2809e4f9 (patch) | |
tree | 1c269a9f666500980ea00cec22a9debf4e174be8 | |
parent | f67344b4c6c7df01dd1e9f3023fa20416103cb6a (diff) | |
download | ingen-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
-rw-r--r-- | ingen/World.hpp | 3 | ||||
-rw-r--r-- | src/World.cpp | 8 | ||||
-rw-r--r-- | src/server/Engine.cpp | 6 | ||||
-rw-r--r-- | src/server/JackDriver.cpp | 5 | ||||
-rw-r--r-- | src/server/Worker.cpp | 3 |
5 files changed, 15 insertions, 10 deletions
diff --git a/ingen/World.hpp b/ingen/World.hpp index e00b23fe..16ad5731 100644 --- a/ingen/World.hpp +++ b/ingen/World.hpp @@ -92,9 +92,6 @@ public: */ virtual bool run_module(const char* name); - /** Unload all loaded Ingen modules. */ - virtual void unload_modules(); - /** A function to create a new remote Interface. */ typedef SharedPtr<Interface> (*InterfaceFactory)( World* world, diff --git a/src/World.cpp b/src/World.cpp index bcdc4d70..0ad655a9 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -143,8 +143,8 @@ public: serialiser.reset(); parser.reset(); interface.reset(); - engine.reset(); store.reset(); + engine.reset(); interface_factories.clear(); script_runners.clear(); @@ -276,12 +276,6 @@ World::run_module(const char* name) return true; } -void -World::unload_modules() -{ - _impl->modules.clear(); -} - /** Get an interface for a remote engine at @a url */ SharedPtr<Interface> 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); } |