2
0
Эх сурвалжийг харах

break on exception thrown

Nicolas Cannasse 7 жил өмнө
parent
commit
1e5545e611
1 өөрчлөгдсөн 3 нэмэгдсэн , 0 устгасан
  1. 3 0
      hxd/System.hl.hx

+ 3 - 0
hxd/System.hl.hx

@@ -113,11 +113,14 @@ class System {
 	}
 
 	static function runMainLoop() {
+		var reportError = function(e) reportError(e);
 		while( true ) {
 			try {
+				hl.Api.setErrorHandler(reportError); // set exception trap
 				@:privateAccess haxe.MainLoop.tick();
 				if( !mainLoop() ) break;
 			} catch( e : Dynamic ) {
+				hl.Api.setErrorHandler(null);
 				reportError(e);
 			}
 		}