浏览代码

moved event loop at init out of __init__ (close #922)

Nicolas Cannasse 4 年之前
父节点
当前提交
30034c663e
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      hxd/System.hl.hx

+ 4 - 3
hxd/System.hl.hx

@@ -402,9 +402,10 @@ class System {
 		sentinel = new hl.UI.Sentinel(30, function() throw "Program timeout (infinite loop?)");
 		haxe.MainLoop.add(timeoutTick, -1) #if (haxe_ver >= 4) .isBlocking = false #end;
 		#end
-		#if (hlsdl || hldx)
-		haxe.MainLoop.add(updateCursor, -1) #if (haxe_ver >= 4) .isBlocking = false #end;
-		#end
 	}
+	
+	#if (hlsdl || hldx)
+	static var _ = haxe.MainLoop.add(updateCursor, -1) #if (haxe_ver >= 4) .isBlocking = false #end;
+	#end
 
 }