diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-08-26 22:03:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-26 22:03:44 +0200 |
commit | 2b202f3dd0cd1900a8302f7404207ed27d7a9ed9 (patch) | |
tree | bc50cb964b6513cc6cc64ea20b9f60006e136104 /editor/find_in_files.cpp | |
parent | 5883f912b3a1b967842f7e9b3bb68bfeb4bd905b (diff) | |
parent | d3c879fe1bbba83aa7c365441422b0dcb22b82f4 (diff) |
Merge pull request #31659 from Klesomik/master
Fix memory leak in Find in Files
Diffstat (limited to 'editor/find_in_files.cpp')
-rw-r--r-- | editor/find_in_files.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index cc2efb92ae..def22d07de 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -221,8 +221,8 @@ float FindInFiles::get_progress() const { void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) { - DirAccess *dir = DirAccess::open(path); - if (dir == NULL) { + DirAccessRef dir = DirAccess::open(path); + if (!dir) { print_verbose("Cannot open directory! " + path); return; } @@ -253,8 +253,8 @@ void FindInFiles::_scan_dir(String path, PoolStringArray &out_folders) { void FindInFiles::_scan_file(String fpath) { - FileAccess *f = FileAccess::open(fpath, FileAccess::READ); - if (f == NULL) { + FileAccessRef f = FileAccess::open(fpath, FileAccess::READ); + if (!f) { print_verbose(String("Cannot open file ") + fpath); return; } |