浏览代码

prevent texture disposal while in clone()

ncannasse 8 年之前
父节点
当前提交
a021155495
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      h3d/mat/Texture.hx

+ 3 - 0
h3d/mat/Texture.hx

@@ -96,8 +96,11 @@ class Texture {
 	}
 
 	public function clone( ?allocPos : h3d.impl.AllocPos ) {
+		var old = lastFrame;
+		preventAutoDispose();
 		var t = new Texture(width, height, null, format, allocPos);
 		h3d.pass.Copy.run(this, t);
+		lastFrame = old;
 		return t;
 	}