Quellcode durchsuchen

cleanup registered callback handlers

ncannasse vor 7 Jahren
Ursprung
Commit
e35a6dd572
1 geänderte Dateien mit 5 neuen und 0 gelöschten Zeilen
  1. 5 0
      hxd/App.hx

+ 5 - 0
hxd/App.hx

@@ -68,6 +68,7 @@ class App implements h3d.IDrawable {
 
 	function setup() {
 		var initDone = false;
+		engine.onReady = staticHandler;
 		engine.onResized = function() {
 			if( s2d == null ) return; // if disposed
 			s2d.checkResize();
@@ -89,6 +90,8 @@ class App implements h3d.IDrawable {
 	}
 
 	function dispose() {
+		engine.onResized = staticHandler;
+		engine.onContextLost = staticHandler;
 		isDisposed = true;
 		s2d.dispose();
 		s3d.dispose();
@@ -116,4 +119,6 @@ class App implements h3d.IDrawable {
 	function update( dt : Float ) {
 	}
 
+	static function staticHandler() {}
+
 }