summaryrefslogtreecommitdiff
path: root/editor/find_in_files.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-21 08:09:07 +0100
committerGitHub <noreply@github.com>2020-01-21 08:09:07 +0100
commit77f04ec52a0e41d3af5f084f8e989f728239b16f (patch)
tree7bddd39f46201993eb8388f146f3edec94e4874a /editor/find_in_files.cpp
parent1508cc405168736b6d7c2fb117e6e4bc72a8afe6 (diff)
parent3042b4f4cb12b4f4f4a02836b5bf55fa0590dd6c (diff)
Merge pull request #35390 from timothyqiu/find-in-files-leak
Fixes leak in Find in Files utility
Diffstat (limited to 'editor/find_in_files.cpp')
-rw-r--r--editor/find_in_files.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp
index 86a4a9ef47..4ab90ad3e4 100644
--- a/editor/find_in_files.cpp
+++ b/editor/find_in_files.cpp
@@ -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;