diff options
author | Haoyu Qiu <timothyqiu32@gmail.com> | 2020-02-16 13:22:25 +0800 |
---|---|---|
committer | Haoyu Qiu <timothyqiu32@gmail.com> | 2020-02-16 13:22:25 +0800 |
commit | 3584e279483847d984d2a6860a00571c0d7d664c (patch) | |
tree | bc2023711fadab080bcc74d2073f3af8fa407178 | |
parent | cb68d832f29d315352e5209e5127d49ec5de77d5 (diff) |
Fixes memory leak when loading StreamTexture
-rw-r--r-- | scene/resources/texture.cpp | 2 |
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; } |