summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-06-08 23:21:37 +0000
committerDavid Robillard <d@drobilla.net>2013-06-08 23:21:37 +0000
commit50b785cfbe4ef9fcfd7b95d6948e457d62cfecf3 (patch)
tree32d85f55d42e1ebe797336afb61085a143c2c902
parent52ec61f7bf5030e030a946cef0499ac23bba69f7 (diff)
downloadingen-50b785cfbe4ef9fcfd7b95d6948e457d62cfecf3.tar.gz
ingen-50b785cfbe4ef9fcfd7b95d6948e457d62cfecf3.tar.bz2
ingen-50b785cfbe4ef9fcfd7b95d6948e457d62cfecf3.zip
Fix crash on destruction when running in LV2.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5130 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/server/Engine.cpp1
-rw-r--r--src/server/ingen_lv2.cpp12
2 files changed, 10 insertions, 3 deletions
diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp
index 5c36f5c2..1dbd73bb 100644
--- a/src/server/Engine.cpp
+++ b/src/server/Engine.cpp
@@ -102,6 +102,7 @@ Engine::~Engine()
s.second.reset();
}
}
+ store->clear();
}
_world->set_store(SPtr<Ingen::Store>());
diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp
index 6f50847b..c8c0b922 100644
--- a/src/server/ingen_lv2.cpp
+++ b/src/server/ingen_lv2.cpp
@@ -651,8 +651,11 @@ ingen_deactivate(LV2_Handle instance)
{
IngenPlugin* me = (IngenPlugin*)instance;
me->world->engine()->deactivate();
- delete me->main;
- me->main = NULL;
+ if (me->main) {
+ me->main->join();
+ delete me->main;
+ me->main = NULL;
+ }
}
static void
@@ -661,7 +664,10 @@ ingen_cleanup(LV2_Handle instance)
IngenPlugin* me = (IngenPlugin*)instance;
me->world->set_engine(SPtr<Ingen::Server::Engine>());
me->world->set_interface(SPtr<Ingen::Interface>());
- delete me->main;
+ if (me->main) {
+ me->main->join();
+ delete me->main;
+ }
delete me->world;
delete me;
}