summaryrefslogtreecommitdiff
path: root/drumgizmo/jackclient.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2022-01-22 20:42:50 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2022-01-22 22:21:44 +0100
commit235ad6fbbce2e0ae9e06db960a5ba3b099936ace (patch)
tree262344b30ef79237d157835ad9fcca4464bef1bc /drumgizmo/jackclient.h
parentd3c643565f6c7ad2824e4896ff8eaea25b95b460 (diff)
Prevent processing jack clients that are being deleted.
Diffstat (limited to 'drumgizmo/jackclient.h')
-rw-r--r--drumgizmo/jackclient.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/drumgizmo/jackclient.h b/drumgizmo/jackclient.h
index f769ab4..04d6654 100644
--- a/drumgizmo/jackclient.h
+++ b/drumgizmo/jackclient.h
@@ -27,7 +27,7 @@
#pragma once
#include <vector>
#include <string>
-#include <set>
+#include <list>
#include <jack/jack.h>
@@ -38,7 +38,7 @@ class JackClient;
class JackProcess
{
public:
- virtual ~JackProcess();
+ virtual ~JackProcess() = default;
virtual void process(jack_nframes_t num_frames) = 0;
virtual void jackLatencyCallback(jack_latency_callback_mode_t mode) {}
};
@@ -76,7 +76,13 @@ public:
private:
jack_client_t* client;
- std::set<JackProcess*> processes;
+ bool dirty{false};
+ struct JackProcessContainer
+ {
+ JackProcess *process;
+ bool active{true};
+ };
+ std::list<JackProcessContainer> processes;
bool is_active;
bool is_freewheeling;