You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Memory leak fixed
In some functions in editor/find_in_files.cpp was detected a memory leak DirAccess* and FileAccess* were replaced by DirAccessRef and FileAccessRef DirAccessRef and FileAccessRef are just wrappers for DirAccess* and FileAccess* Fixes for issue #31659
This commit is contained in:
@@ -221,8 +221,8 @@ float FindInFiles::get_progress() const {
|
|||||||
|
|
||||||
void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) {
|
void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) {
|
||||||
|
|
||||||
DirAccess *dir = DirAccess::open(path);
|
DirAccessRef dir = DirAccess::open(path);
|
||||||
if (dir == NULL) {
|
if (!dir) {
|
||||||
print_verbose("Cannot open directory! " + path);
|
print_verbose("Cannot open directory! " + path);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -253,8 +253,8 @@ void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) {
|
|||||||
|
|
||||||
void FindInFiles::_scan_file(String fpath) {
|
void FindInFiles::_scan_file(String fpath) {
|
||||||
|
|
||||||
FileAccess *f = FileAccess::open(fpath, FileAccess::READ);
|
FileAccessRef f = FileAccess::open(fpath, FileAccess::READ);
|
||||||
if (f == NULL) {
|
if (!f) {
|
||||||
print_verbose(String("Cannot open file ") + fpath);
|
print_verbose(String("Cannot open file ") + fpath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user