summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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;