Browse Source

wakeup after onAbort (prevent exit before print stack) + fix for hl debugger

Nicolas Cannasse 1 month ago
parent
commit
efa61f2991
1 changed files with 4 additions and 1 deletions
  1. 4 1
      std/sys/thread/Thread.hx

+ 4 - 1
std/sys/thread/Thread.hx

@@ -149,15 +149,18 @@ class Thread {
 			currentTLS.value = t;
 			currentTLS.value = t;
 			var exception = null;
 			var exception = null;
 			try {
 			try {
+				#if hl
+				hl.Api.setErrorHandler(null);
+				#end
 				job();
 				job();
 				t.events.loop();
 				t.events.loop();
 			} catch( e ) {
 			} catch( e ) {
 				exception = e;
 				exception = e;
 			}
 			}
 			t.dispose();
 			t.dispose();
-			@:privateAccess main().events.wakeup();
 			if( exception != null )
 			if( exception != null )
 				t.onAbort(exception);
 				t.onAbort(exception);
+			@:privateAccess main().events.wakeup();
 		});
 		});
 		return t;
 		return t;
 	}
 	}