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:
parent
6cff481c6a
commit
4448ef6a59
3 changed files with 7 additions and 3 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -306,7 +306,6 @@ MainComponent::MainComponent()
|
|||
MainComponent::~MainComponent()
|
||||
{
|
||||
contentComponent->clearCurrentDemo();
|
||||
sharedAudioDeviceManager.reset();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue