diff --git a/source/utils/CarlaJuceEvents.cpp b/source/utils/CarlaJuceEvents.cpp index fb9eabd46..7bde97ddc 100644 --- a/source/utils/CarlaJuceEvents.cpp +++ b/source/utils/CarlaJuceEvents.cpp @@ -125,18 +125,23 @@ void MessageManager::doPlatformSpecificInitialisation() { JuceEventsThread& juceEventsThread(getJuceEventsThreadInstance()); - if (! juceEventsThread.isInitializing()) - juceEventsThread.startThread(); + // TESTING + CARLA_SAFE_ASSERT(! juceEventsThread.isInitializing()); + + juceEventsThread.startThread(); + + for (; juceEventsThread.isInitializing();) + carla_msleep(5); } void MessageManager::doPlatformSpecificShutdown() { JuceEventsThread& juceEventsThread(getJuceEventsThreadInstance()); - if (juceEventsThread.isInitializing()) - juceEventsThread.signalThreadShouldExit(); - else - juceEventsThread.stopThread(-1); + // TESTING + CARLA_SAFE_ASSERT(! juceEventsThread.isInitializing()); + + juceEventsThread.stopThread(-1); } bool MessageManager::postMessageToSystemQueue(MessageManager::MessageBase* const message)