浏览代码

some @:noDebug + dispose on inspector

ncannasse 9 年之前
父节点
当前提交
bbfbfce394
共有 4 个文件被更改,包括 18 次插入0 次删除
  1. 1 0
      h2d/col/Polygon.hx
  2. 1 0
      h3d/scene/Skin.hx
  3. 7 0
      hxd/net/PropInspector.hx
  4. 9 0
      hxd/net/SceneInspector.hx

+ 1 - 0
h2d/col/Polygon.hx

@@ -121,6 +121,7 @@ abstract Polygon(Array<Point>) from Array<Point> to Array<Point> {
 		this.reverse();
 	}
 
+	@:noDebug
 	public function contains( p : Point, isConvex = false ) {
 		if( isConvex ) {
 			var p1 = points[points.length - 1];

+ 1 - 0
h3d/scene/Skin.hx

@@ -159,6 +159,7 @@ class Skin extends MultiMaterial {
 			splitPalette = null;
 	}
 
+	@:noDebug
 	override function sync( ctx : RenderContext ) {
 		if( culled && !alwaysSync )
 			return;

+ 7 - 0
hxd/net/PropInspector.hx

@@ -45,6 +45,13 @@ class PropInspector extends cdb.jq.Client {
 		connect();
 	}
 
+	public function dispose() {
+		if( sock != null ) {
+			sock.close();
+			sock = null;
+		}
+	}
+
 	override function onKey(e:cdb.jq.Event) {
 		switch( e.keyCode ) {
 		case 'Z'.code if( e.ctrlKey ):

+ 9 - 0
hxd/net/SceneInspector.hx

@@ -208,6 +208,15 @@ class SceneInspector {
 		addTool("Statistics", "bar-chart", getStats, "Open statistics");
 	}
 
+	public function dispose() {
+		inspect.dispose();
+		scene = null;
+		if( oldLoop != null ) {
+			hxd.System.setLoop(oldLoop);
+			oldLoop = null;
+		}
+	}
+
 	inline function get_connected() {
 		return inspect.connected;
 	}