1
0
Fork 0
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:
reuk 2021-10-14 14:04:19 +01:00
parent 51355b03df
commit cfda532c9f
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -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;
}