diff --git a/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp b/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp index 9abd73a38c..e395667492 100644 --- a/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp +++ b/extras/AudioPluginHost/Source/UI/MainHostWindow.cpp @@ -81,8 +81,9 @@ MainHostWindow::MainHostWindow() formatManager.addDefaultFormats(); formatManager.addFormat (new InternalPluginFormat()); + auto safeThis = SafePointer (this); RuntimePermissions::request (RuntimePermissions::recordAudio, - [safeThis = SafePointer (this)] (bool granted) mutable + [safeThis] (bool granted) mutable { std::unique_ptr savedAudioState (getAppProperties().getUserSettings() ->getXmlValue ("audioDeviceState")); @@ -573,9 +574,11 @@ void MainHostWindow::showAudioSettings() o.resizable = false; auto* w = o.create(); + auto safeThis = SafePointer (this); + w->enterModalState (true, ModalCallbackFunction::create - ([safeThis = SafePointer (this)] (int) + ([safeThis] (int) { std::unique_ptr audioState (safeThis->deviceManager.createStateXml());