fix: more stable engine exit

This commit is contained in:
TopchetoEU 2025-01-06 17:05:37 +02:00
parent 0b6484e0b4
commit 51b347e0d7
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4
2 changed files with 4 additions and 2 deletions

View File

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

View File

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