(cherry picked from commit 599ccbb7d47407bbe32df12fbb3c51f4b19ae602)
@@ -926,6 +926,7 @@ void EditorSettings::create() {
String config_file_name = "editor_settings-" + itos(VERSION_MAJOR) + ".tres";
config_file_path = config_dir.plus_file(config_file_name);
if (!dir->file_exists(config_file_name)) {
+ memdelete(dir);
goto fail;
}