浏览代码

set some pixels to null (prevent some errors when accessing after remove)

Nicolas Cannasse 5 年之前
父节点
当前提交
b1ccbe7d66
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      hrt/prefab/terrain/Tile.hx

+ 9 - 3
hrt/prefab/terrain/Tile.hx

@@ -56,12 +56,18 @@ class Tile extends h3d.scene.Mesh {
 			surfaceWeightArray.dispose();
 		if( bigPrim != null )
 			bigPrim.dispose();
-		if(packedWeightMapPixel != null)
+		if(packedWeightMapPixel != null) {
 			packedWeightMapPixel.dispose();
-		if(indexMapPixels != null)
+			packedWeightMapPixel = null;
+		}
+		if(indexMapPixels != null) {
 			indexMapPixels.dispose();
-		if(heightmapPixels != null)
+			indexMapPixels = null;
+		}
+		if(heightmapPixels != null) {
 			heightmapPixels.dispose();
+			heightmapPixels = null;
+		}
 		normalTangentBytes = null;
 
 	}