mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 16:33:30 +00:00
Convert uses of DirAccess * to DirAccessRef to prevent memleaks
`DirAccess *` needs to be deleted manually, and this is often forgotten especially when doing early returns with `ERR_FAIL_COND`. `DirAccessRef` is deleted automatically when it goes out of scope. Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
This commit is contained in:
parent
259114e9e0
commit
768f9422bc
28 changed files with 154 additions and 259 deletions
|
|
@ -124,7 +124,7 @@ void JavaScriptToolsEditorPlugin::_zip_file(String p_path, String p_base_path, z
|
|||
}
|
||||
|
||||
void JavaScriptToolsEditorPlugin::_zip_recursive(String p_path, String p_base_path, zipFile p_zip) {
|
||||
DirAccess *dir = DirAccess::open(p_path);
|
||||
DirAccessRef dir = DirAccess::open(p_path);
|
||||
if (!dir) {
|
||||
WARN_PRINT("Unable to open directory for zipping: " + p_path);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue