瀏覽代碼

Compile define -D heaps_no_error_trap to suppress trapping exceptions… (#1121)

Ryan Cleven 2 年之前
父節點
當前提交
4c3c4eeccc
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      hxd/System.hl.hx

+ 4 - 1
hxd/System.hl.hx

@@ -139,9 +139,10 @@ class System {
 		var eventRecycle = [];
 		#end
 		while( true ) {
+			#if !heaps_no_error_trap
 			try {
 				hl.Api.setErrorHandler(reportError); // set exception trap
-
+			#end
 				#if ( target.threaded && (haxe_ver >= 4.2) )
 				// Due to how 4.2+ timers work, instead of MainLoop, thread events have to be updated.
 				// Unsafe events rely on internal implementation of EventLoop, but utilize the recycling feature
@@ -156,9 +157,11 @@ class System {
 				#end
 
 				if( !mainLoop() ) break;
+			#if !heaps_no_error_trap
 			} catch( e : Dynamic ) {
 				hl.Api.setErrorHandler(null);
 			}
+			#end
 			#if hot_reload
 			if( check_reload() ) onReload();
 			#end