From 8ff9ee4c99bd3dd3b96639016ec208427a337080 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 8 Aug 2014 11:57:08 +0100 Subject: [PATCH] Fix juce engine drivers only be usable once --- source/backend/engine/CarlaEngineJuce.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/backend/engine/CarlaEngineJuce.cpp b/source/backend/engine/CarlaEngineJuce.cpp index 76e134dfb..d0472cf28 100644 --- a/source/backend/engine/CarlaEngineJuce.cpp +++ b/source/backend/engine/CarlaEngineJuce.cpp @@ -48,16 +48,16 @@ struct JuceCleanup : public DeletedAtShutdown { static void initJuceDevicesIfNeeded() { static AudioDeviceManager sDeviceManager; - static bool needsInit = true; - if (! needsInit) + if (gDeviceTypes.size() != 0) return; - needsInit = false; - new JuceCleanup(); - sDeviceManager.createAudioDeviceTypes(gDeviceTypes); + CARLA_SAFE_ASSERT_RETURN(gDeviceTypes.size() != 0,); + + new JuceCleanup(); + // remove JACK from device list for (int i=0, count=gDeviceTypes.size(); i < count; ++i) {