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:
Alexey Andreev 2017-02-25 19:51:39 +03:00
parent a94686ddf6
commit 929e77bf69

View File

@ -344,9 +344,11 @@ public class TObject {
@Override
public void onTimer() {
if (!expired()) {
run();
}
Platform.postpone(() -> {
if (!expired()) {
run();
}
});
}
@Override