You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Fix memory leak after closing files
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user