Browse Source

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

Nicolas Cannasse 5 năm trước cách đây
mục cha
commit
b1ccbe7d66
1 tập tin đã thay đổi với 9 bổ sung3 xóa
  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;
 
 	}