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
This commit is contained in:
Dan Nicholson 2024-07-24 21:15:05 -06:00
parent f4ea4e5e90
commit c819b25f32
1 changed files with 1 additions and 0 deletions

View File

@ -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")) {