From 355614f86d103f1c0ecc0639cce77803616a1e24 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 13 Jan 2018 14:21:25 -0500 Subject: [PATCH] Close stream upon destructing AudioInterface --- src/core/AudioInterface.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/core/AudioInterface.cpp b/src/core/AudioInterface.cpp index fe90229c..dd05a6d6 100644 --- a/src/core/AudioInterface.cpp +++ b/src/core/AudioInterface.cpp @@ -39,11 +39,6 @@ struct AudioInterfaceIO : AudioIO { maxInputs = MAX_INPUTS; } - ~AudioInterfaceIO() { - // Wait until processStream() is finished - std::lock_guard lock(audioMutex); - } - void processStream(const float *input, float *output, int length) override { if (numInputs > 0) { // TODO Do we need to wait on the input to be consumed here? @@ -111,6 +106,10 @@ struct AudioInterface : Module { AudioInterface() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS) { } + ~AudioInterface() { + audioIO.closeStream(); + } + void step() override; json_t *toJson() override {