diff options
Diffstat (limited to 'editor/editor_settings.cpp')
| -rw-r--r-- | editor/editor_settings.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 7e24f632bc..b9a6414b08 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -253,13 +253,14 @@ static void _create_script_templates(const String &p_path) { dir->change_dir(p_path); for (int i = 0; i < keys.size(); i++) { if (!dir->file_exists(keys[i])) { - file->reopen(p_path.plus_file((String)keys[i]), FileAccess::WRITE); - ERR_FAIL_COND(!file); + Error err = file->reopen(p_path.plus_file((String)keys[i]), FileAccess::WRITE); + ERR_FAIL_COND(err != OK); file->store_string(templates[keys[i]]); file->close(); } } + memdelete(dir); memdelete(file); } @@ -286,6 +287,7 @@ void EditorSettings::create() { self_contained = true; extra_config->load(exe_path + "/_sc_"); } + memdelete(d); if (self_contained) { // editor is self contained |