Merge pull request #31659 from Klesomik/master

Fix memory leak in Find in Files
This commit is contained in:
Rémi Verschelde 2019-08-26 22:03:44 +02:00 committed by GitHub
commit 2b202f3dd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}