summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-04-25 21:22:19 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-04-25 21:22:19 +0200
commit215bade4f4d5b590d03c12fc62f1a20e3fa59ef3 (patch)
tree12bbba17d9d2c1822ee46ef3290ecfd272008435 /src
parent25b7c03c47f8558e4759b0845eb367b580f3f9b4 (diff)
Fixed crash on plugin-unload while drumkit load is in progress.
Diffstat (limited to 'src')
-rw-r--r--src/drumgizmo.cc1
-rw-r--r--src/drumkitloader.cc9
-rw-r--r--src/drumkitloader.h2
3 files changed, 12 insertions, 0 deletions
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
@@ -40,6 +40,13 @@ DrumKitLoader::DrumKitLoader(DrumGizmo *dg)
DrumKitLoader::~DrumKitLoader()
{
+ if(!quitit) {
+ stop();
+ }
+}
+
+void DrumKitLoader::stop()
+{
quitit = true;
semaphore.post();
wait_stop();
@@ -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;