From 3042b4f4cb12b4f4f4a02836b5bf55fa0590dd6c Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Tue, 21 Jan 2020 08:47:59 +0800 Subject: [PATCH] Fixes leak in Find in Files utility --- editor/find_in_files.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 86a4a9ef475..4ab90ad3e4f 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 // 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;