summaryrefslogtreecommitdiff
path: root/scene/resources/texture.cpp
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2020-02-16 13:22:25 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2020-02-16 13:22:25 +0800
commit3584e279483847d984d2a6860a00571c0d7d664c (patch)
treebc2023711fadab080bcc74d2073f3af8fa407178 /scene/resources/texture.cpp
parentcb68d832f29d315352e5209e5127d49ec5de77d5 (diff)
Fixes memory leak when loading StreamTexture
Diffstat (limited to 'scene/resources/texture.cpp')
-rw-r--r--scene/resources/texture.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 4ddceed58e..ff9c786b4c 100644
--- a/scene/resources/texture.cpp
+++ b/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;
}