소스 검색

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;
 
 	}