Browse Source

cleanup registered callback handlers

ncannasse 7 years ago
parent
commit
e35a6dd572
1 changed files with 5 additions and 0 deletions
  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() {}
+
 }