mirror of
https://github.com/konsoletyper/teavm.git
synced 2024-11-27 01:30:35 +08:00
Postpone execution code after wait
method, since it's executed in a native callback which can't be async. When the code contains async calls, compiler produces error.
This commit is contained in:
parent
a94686ddf6
commit
929e77bf69
@ -344,9 +344,11 @@ public class TObject {
|
||||
|
||||
@Override
|
||||
public void onTimer() {
|
||||
if (!expired()) {
|
||||
run();
|
||||
}
|
||||
Platform.postpone(() -> {
|
||||
if (!expired()) {
|
||||
run();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user