mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
iOS Windowing: Avoid crashing when displaying a message box from a background thread
This commit is contained in:
parent
51355b03df
commit
cfda532c9f
1 changed files with 7 additions and 1 deletions
|
|
@ -523,7 +523,13 @@ static int showDialog (const MessageBoxOptions& options,
|
|||
}
|
||||
#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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue