Browse Source

iOS Windowing: Avoid crashing when displaying a message box from a background thread

v6.1.6
reuk 4 years ago
parent
commit
cfda532c9f
No known key found for this signature in database GPG Key ID: 9ADCD339CFC98A11
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      modules/juce_gui_basics/native/juce_ios_Windowing.mm

+ 7
- 1
modules/juce_gui_basics/native/juce_ios_Windowing.mm View File

@@ -523,7 +523,13 @@ static int showDialog (const MessageBoxOptions& options,
} }
#endif #endif
new iOSMessageBox (options, AlertWindowMappings::getWrappedCallback (callbackIn, mapFn));
const auto showBox = [options, callbackIn, mapFn] { new iOSMessageBox (options, AlertWindowMappings::getWrappedCallback (callbackIn, mapFn)); };
if (MessageManager::getInstance()->isThisTheMessageThread())
showBox();
else
MessageManager::callAsync (showBox);
return 0; return 0;
} }


Loading…
Cancel
Save