summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-04-05 12:18:45 +0200
committerGitHub <noreply@github.com>2021-04-05 12:18:45 +0200
commit1cd3a3b070a9e17acdbe9a875a305643bc834e6a (patch)
tree6e9ffea59f500ac04cecffcc83e6c261888bee62
parent295d5429114bd11280f910a1f5e9fd1367886c1a (diff)
downloadopenttd-1cd3a3b070a9e17acdbe9a875a305643bc834e6a.tar.xz
Fix #8935: [OSX] Crash when clicking 'Save' due to wrongly-threaded OS call. (#8944)
-rw-r--r--src/video/cocoa/cocoa_v.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm
index 9fb74cd04..c16d19690 100644
--- a/src/video/cocoa/cocoa_v.mm
+++ b/src/video/cocoa/cocoa_v.mm
@@ -224,7 +224,7 @@ bool VideoDriver_Cocoa::AfterBlitterChange()
*/
void VideoDriver_Cocoa::EditBoxLostFocus()
{
- [ [ this->cocoaview inputContext ] discardMarkedText ];
+ [ [ this->cocoaview inputContext ] performSelectorOnMainThread:@selector(discardMarkedText) withObject:nil waitUntilDone:[ NSThread isMainThread ] ];
/* Clear any marked string from the current edit box. */
HandleTextInput(nullptr, true);
}