summaryrefslogtreecommitdiffstats
path: root/src/server/ingen_lv2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/ingen_lv2.cpp')
-rw-r--r--src/server/ingen_lv2.cpp12
1 files changed, 9 insertions, 3 deletions
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;
}