From 215bade4f4d5b590d03c12fc62f1a20e3fa59ef3 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Thu, 25 Apr 2013 21:22:19 +0200 Subject: Fixed crash on plugin-unload while drumkit load is in progress. --- src/drumgizmo.cc | 1 + src/drumkitloader.cc | 9 +++++++++ src/drumkitloader.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc index 32ad66e..b5e5c63 100644 --- a/src/drumgizmo.cc +++ b/src/drumgizmo.cc @@ -56,6 +56,7 @@ DrumGizmo::~DrumGizmo() i++; } */ + loader.stop(); } /* diff --git a/src/drumkitloader.cc b/src/drumkitloader.cc index be74624..c997dfb 100644 --- a/src/drumkitloader.cc +++ b/src/drumkitloader.cc @@ -39,6 +39,13 @@ DrumKitLoader::DrumKitLoader(DrumGizmo *dg) } DrumKitLoader::~DrumKitLoader() +{ + if(!quitit) { + stop(); + } +} + +void DrumKitLoader::stop() { quitit = true; semaphore.post(); @@ -125,6 +132,8 @@ void DrumKitLoader::thread_main() drumgizmo->sendGUIMessage(ls); a++; + + if(quitit) return; } i++; diff --git a/src/drumkitloader.h b/src/drumkitloader.h index b9bc102..f614ea0 100644 --- a/src/drumkitloader.h +++ b/src/drumkitloader.h @@ -48,6 +48,8 @@ public: bool isDone(); + void stop(); + private: DrumGizmo *drumgizmo; Semaphore semaphore; -- cgit v1.2.3