From d88c1ffb6a725ba66ca85ad2410e4f45ddb7afbc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 30 Dec 2013 02:30:40 +0000 Subject: Fix deadlocks on exit. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5225 a436a847-0d15-0410-975c-d299462d15a1 --- src/World.cpp | 15 ++++++++------- src/server/JackDriver.cpp | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/World.cpp b/src/World.cpp index 55cdea9c..1e0f82c0 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -154,6 +154,14 @@ public: ~Impl() { + // Delete module objects but save pointers to libraries + typedef std::list Libs; + Libs libs; + for (auto& m : modules) { + libs.push_back(m.second->library); + delete m.second; + } + serialiser.reset(); parser.reset(); interface.reset(); @@ -163,13 +171,6 @@ public: interface_factories.clear(); script_runners.clear(); - // Delete module objects but save pointers to libraries - typedef std::list Libs; - Libs libs; - for (auto& m : modules) { - libs.push_back(m.second->library); - delete m.second; - } delete rdf_world; delete lv2_features; diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp index ad68b64d..32dd625f 100644 --- a/src/server/JackDriver.cpp +++ b/src/server/JackDriver.cpp @@ -174,7 +174,7 @@ JackDriver::deactivate() if (_is_activated) { _flag = true; _is_activated = false; - _sem.wait(); + _sem.timed_wait(1000); for (auto& p : _ports) { unregister_port(p); -- cgit v1.2.1