浏览代码

reset NetworkHost.current to null on close()

Nicolas Cannasse 8 年之前
父节点
当前提交
8cdbc3b397
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      hxd/net/SocketHost.hx

+ 1 - 0
hxd/net/SocketHost.hx

@@ -80,6 +80,7 @@ class SocketHost extends NetworkHost {
 			socket = null;
 		}
 		connected = false;
+		if( NetworkHost.current == this ) NetworkHost.current = null;
 	}
 
 	public function connect( host : String, port : Int, ?onConnect : Bool -> Void ) {