From c819b25f32378d4edfc7cc5b73d1cc5881961359 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Wed, 24 Jul 2024 21:15:05 -0600 Subject: [PATCH] LocalDebugger: Disable scripting when quitting Quitting the main loop will make it stop iterating, but that won't make the script engine stop running. In the worst case, the script can complete if it's outside of the event loop and the process may exit with the wrong status code. Fixes: #51387 --- core/debugger/local_debugger.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/debugger/local_debugger.cpp b/core/debugger/local_debugger.cpp index b7af9c70861..85d197b3d49 100644 --- a/core/debugger/local_debugger.cpp +++ b/core/debugger/local_debugger.cpp @@ -292,6 +292,7 @@ void LocalDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) { MainLoop *main_loop = OS::get_singleton()->get_main_loop(); if (main_loop->get_class() == "SceneTree") { main_loop->call("quit", exit_code); + ScriptServer::set_scripting_enabled(false); } break; } else if (line.begins_with("delete")) {