Merge pull request #35390 from timothyqiu/find-in-files-leak

Fixes leak in Find in Files utility
This commit is contained in:
Rémi Verschelde 2020-01-21 08:09:07 +01:00 committed by GitHub
commit 77f04ec52a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -828,8 +828,8 @@ void FindInFilesPanel::apply_replaces_in_file(String fpath, const Vector<Result>
// If there are unsaved changes, the user will be asked on focus,
// however that means either losing changes or losing replaces.
FileAccess *f = FileAccess::open(fpath, FileAccess::READ);
ERR_FAIL_COND_MSG(f == NULL, "Cannot open file from path '" + fpath + "'.");
FileAccessRef f = FileAccess::open(fpath, FileAccess::READ);
ERR_FAIL_COND_MSG(!f, "Cannot open file from path '" + fpath + "'.");
String buffer;
int current_line = 1;