浏览代码

Fixes memory leak when loading StreamTexture

Haoyu Qiu 5 年之前
父节点
当前提交
3584e27948
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      scene/resources/texture.cpp

+ 2 - 0
scene/resources/texture.cpp

@@ -588,6 +588,8 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &tw_
 
 	image = load_image_from_file(f, p_size_limit);
 
+	memdelete(f);
+
 	if (image.is_null() || image->empty()) {
 		return ERR_CANT_OPEN;
 	}