Skip to content

Commit

Permalink
LocalDebugger: Disable scripting when quitting
Browse files Browse the repository at this point in the history
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: godotengine#51387
  • Loading branch information
dbnicholson committed Jul 26, 2024
1 parent f4ea4e5 commit c819b25
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/debugger/local_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down

0 comments on commit c819b25

Please sign in to comment.