Silently stop all script debuggers if no debugging server is active

Co-authored-by: Krzysztof Biegański <krzysztof@biegan.ski>
This commit is contained in:
Ricardo Subtil
2026-01-21 14:37:32 +00:00
parent a8e37fc010
commit 31c1bb8157
+11 -6
View File
@@ -313,6 +313,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);
@@ -325,12 +336,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);