Explorar o código

realloc before clone()

ncannasse %!s(int64=7) %!d(string=hai) anos
pai
achega
b15049c3ad
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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 = [];