Просмотр исходного кода

Merge pull request #36260 from timothyqiu/texture-memleak

Fixes memory leak when loading StreamTexture
Rémi Verschelde 5 лет назад
Родитель
Сommit
57823a3266
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;
 	}