Merge pull request #117434 from rsubtil/fix-script_debugger_stop

Silently stop all script debuggers if no debugging server is active
This commit is contained in:
Thaddeus Crews
2026-04-18 07:28:33 -05:00
+11 -6
View File
@@ -311,6 +311,17 @@ void EditorDebuggerNode::stop(bool p_force) {
inspect_edited_object_wait = false;
current_uri.clear();
// Also close all debugging sessions.
_for_all(tabs, [&](ScriptEditorDebugger *dbg) {
// If the server is also still active, let the debugger notify that it stopped.
// Otherwise, just stop it silently.
if (server.is_valid() || dbg->is_session_active()) {
dbg->_stop_and_notify();
} else {
dbg->stop();
}
});
if (server.is_valid()) {
server->stop();
EditorNode::get_log()->add_message("--- Debugging process stopped ---", EditorLog::MSG_TYPE_EDITOR);
@@ -323,12 +334,6 @@ void EditorDebuggerNode::stop(bool p_force) {
server.unref();
}
// Also close all debugging sessions.
_for_all(tabs, [&](ScriptEditorDebugger *dbg) {
if (dbg->is_session_active()) {
dbg->_stop_and_notify();
}
});
_break_state_changed();
breakpoints.clear();
EditorUndoRedoManager::get_singleton()->clear_history(EditorUndoRedoManager::REMOTE_HISTORY, false);