Browse Source

Close stream upon destructing AudioInterface

tags/v0.6.0
Andrew Belt 7 years ago
parent
commit
355614f86d
1 changed files with 4 additions and 5 deletions
  1. +4
    -5
      src/core/AudioInterface.cpp

+ 4
- 5
src/core/AudioInterface.cpp View File

@@ -39,11 +39,6 @@ struct AudioInterfaceIO : AudioIO {
maxInputs = MAX_INPUTS;
}

~AudioInterfaceIO() {
// Wait until processStream() is finished
std::lock_guard<std::mutex> 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 {


Loading…
Cancel
Save