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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user