1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

DemoRunner: Fixed a race condition on shutdown

This commit is contained in:
Tom Poole 2018-07-11 13:56:47 +01:00
parent 6cff481c6a
commit 4448ef6a59
3 changed files with 7 additions and 3 deletions

View file

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

View file

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

View file

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