diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/TObject.java b/classlib/src/main/java/org/teavm/classlib/java/lang/TObject.java index b4b0fbb47..d6fad8ed6 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/TObject.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/TObject.java @@ -344,9 +344,11 @@ public class TObject { @Override public void onTimer() { - if (!expired()) { - run(); - } + Platform.postpone(() -> { + if (!expired()) { + run(); + } + }); } @Override