Browse Source

DemoRunner: Fixed a race condition on shutdown

tags/2021-05-28
Tom Poole 7 years ago
parent
commit
4448ef6a59
3 changed files with 7 additions and 3 deletions
  1. +0
    -2
      examples/DemoRunner/Source/Demos/JUCEDemos.cpp
  2. +7
    -0
      examples/DemoRunner/Source/Main.cpp
  3. +0
    -1
      examples/DemoRunner/Source/UI/MainComponent.cpp

+ 0
- 2
examples/DemoRunner/Source/Demos/JUCEDemos.cpp View File

@@ -85,8 +85,6 @@ File JUCEDemos::findExamplesDirectoryFromExecutable (File exec)
} }
//============================================================================== //==============================================================================
std::unique_ptr<AudioDeviceManager> sharedAudioDeviceManager;
static String getCurrentDefaultAudioDeviceName (AudioDeviceManager& deviceManager, bool isInput) static String getCurrentDefaultAudioDeviceName (AudioDeviceManager& deviceManager, bool isInput)
{ {
auto* deviceType = deviceManager.getCurrentDeviceTypeObject(); auto* deviceType = deviceManager.getCurrentDeviceTypeObject();


+ 7
- 0
examples/DemoRunner/Source/Main.cpp View File

@@ -73,6 +73,8 @@
}; };
#endif #endif
std::unique_ptr<AudioDeviceManager> sharedAudioDeviceManager;
//============================================================================== //==============================================================================
class DemoRunnerApplication : public JUCEApplication class DemoRunnerApplication : public JUCEApplication
{ {
@@ -80,6 +82,11 @@ public:
//============================================================================== //==============================================================================
DemoRunnerApplication() {} DemoRunnerApplication() {}
~DemoRunnerApplication()
{
sharedAudioDeviceManager.reset();
}
const String getApplicationName() override { return ProjectInfo::projectName; } const String getApplicationName() override { return ProjectInfo::projectName; }
const String getApplicationVersion() override { return ProjectInfo::versionString; } const String getApplicationVersion() override { return ProjectInfo::versionString; }
bool moreThanOneInstanceAllowed() override { return true; } bool moreThanOneInstanceAllowed() override { return true; }


+ 0
- 1
examples/DemoRunner/Source/UI/MainComponent.cpp View File

@@ -306,7 +306,6 @@ MainComponent::MainComponent()
MainComponent::~MainComponent() MainComponent::~MainComponent()
{ {
contentComponent->clearCurrentDemo(); contentComponent->clearCurrentDemo();
sharedAudioDeviceManager.reset();
} }
//============================================================================== //==============================================================================


Loading…
Cancel
Save