Fixes memory leak when loading StreamTexture
This commit is contained in:
parent
cb68d832f2
commit
3584e27948
1 changed files with 2 additions and 0 deletions
|
@ -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);
|
image = load_image_from_file(f, p_size_limit);
|
||||||
|
|
||||||
|
memdelete(f);
|
||||||
|
|
||||||
if (image.is_null() || image->empty()) {
|
if (image.is_null() || image->empty()) {
|
||||||
return ERR_CANT_OPEN;
|
return ERR_CANT_OPEN;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue