fix: more stable engine exit

This commit is contained in:
2025-01-06 17:05:37 +02:00
parent 0b6484e0b4
commit 51b347e0d7
2 changed files with 4 additions and 2 deletions

View File

@@ -40,7 +40,7 @@ public final class Engine implements EventLoop {
try {
((Task<Object>)task).notifier.complete(task.runnable.get());
}
catch (CancellationException e) { throw e; }
catch (CancellationException e) { task.notifier.cancel(false); throw e; }
catch (RuntimeException e) { task.notifier.completeExceptionally(e); }
}
catch (InterruptedException | CancellationException e) {

View File

@@ -213,7 +213,9 @@ public final class Frame {
catch (StackOverflowError e) { throw STACK_OVERFLOW; }
catch (EngineException e) { error = e; }
catch (RuntimeException e) {
if (!(e instanceof CancellationException)) {
System.out.println(dbg.getMapOrEmpty(function).toLocation(codePtr, true));
}
throw e;
}
}