diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-06-10 15:23:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-10 15:23:26 +0200 |
commit | ee86b18a5e4fecbb50960652da4b8e2e20912226 (patch) | |
tree | e297a2d844f55e8b529c22bce6ebe06eda9f777c /editor | |
parent | 7f3c2e7b0c722c8cef026a7a15ed9296c3c22407 (diff) | |
parent | 53c0a29fb05343e979fda7faf4fde35020e0fefe (diff) |
Merge pull request #29497 from qarmin/fix_memory_leak_in_files
Fix memory leak after closing files
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/asset_library_editor_plugin.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 0dfb53b34a..a0774ac696 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -733,6 +733,7 @@ void EditorAssetLibrary::_image_update(bool use_cache, bool final, const PoolByt image_data = cached_data; file->close(); + memdelete(file); } } @@ -807,6 +808,7 @@ void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, cons if (file) { file->store_line(new_etag); file->close(); + memdelete(file); } int len = p_data.size(); @@ -816,6 +818,7 @@ void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, cons file->store_32(len); file->store_buffer(r.ptr(), len); file->close(); + memdelete(file); } break; @@ -855,6 +858,7 @@ void EditorAssetLibrary::_update_image_queue() { if (file) { headers.push_back("If-None-Match: " + file->get_line()); file->close(); + memdelete(file); } } |