From 50b785cfbe4ef9fcfd7b95d6948e457d62cfecf3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 8 Jun 2013 23:21:37 +0000 Subject: Fix crash on destruction when running in LV2. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5130 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/Engine.cpp | 1 + src/server/ingen_lv2.cpp | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'src/server') 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()); 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()); me->world->set_interface(SPtr()); - delete me->main; + if (me->main) { + me->main->join(); + delete me->main; + } delete me->world; delete me; } -- cgit v1.2.1