Skip to content

Commit 8b7ee84

Browse files
committed
Fix haxe.MainLoop use for haxe 5
1 parent a2ed744 commit 8b7ee84

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/lime/system/JNI.hx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,13 @@ class JNISafetyTools
466466

467467
// Check the thread before running the function.
468468
f.expr = macro
469-
if (!lime.system.JNI.JNISafetyTools.onMainThread())
470-
haxe.MainLoop.runInMainThread($i{field.name}.bind($a{args}))
471-
else
469+
if (!lime.system.JNI.JNISafetyTools.onMainThread()) {
470+
#if haxe5
471+
haxe.EventLoop.main.run($i{field.name}.bind($a{args}));
472+
#else
473+
haxe.MainLoop.runInMainThread($i{field.name}.bind($a{args}));
474+
#end
475+
} else
472476
${f.expr};
473477
default:
474478
}

0 commit comments

Comments
 (0)