From d7766827418c668368a99f5b34d1cd39de132494 Mon Sep 17 00:00:00 2001 From: Ricardo Subtil Date: Sat, 8 Mar 2025 10:58:09 +0000 Subject: [PATCH] Fix recovery mode lock file not being cleared on import/export --- main/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main/main.cpp b/main/main.cpp index e65f894c549..5a3a651fcd9 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -4662,6 +4662,12 @@ void Main::cleanup(bool p_force) { ResourceSaver::remove_custom_savers(); PropertyListHelper::clear_base_helpers(); + // Remove the lock file if the engine exits successfully. Some automated processes such as + // --export/--import can bypass and/or finish faster than the existing check to remove the lock file. + if (OS::get_singleton()->get_exit_code() == EXIT_SUCCESS) { + OS::get_singleton()->remove_lock_file(); + } + // Flush before uninitializing the scene, but delete the MessageQueue as late as possible. message_queue->flush();