ソースを参照

realloc before clone()

ncannasse 7 年 前
コミット
b15049c3ad
1 ファイル変更5 行追加0 行削除
  1. 5 0
      h3d/mat/Texture.hx

+ 5 - 0
h3d/mat/Texture.hx

@@ -99,6 +99,11 @@ class Texture {
 	}
 
 	public function clone( ?allocPos : h3d.impl.AllocPos ) {
+		if( t == null ) {
+			if( realloc == null ) throw "Can't clone disposed texture";
+			alloc();
+			realloc();
+		}
 		var old = lastFrame;
 		preventAutoDispose();
 		var flags = [];