Merge pull request #119992 from KoBeWi/typical_ObjectID_to_prevent_crash

Prevent crash when detaching freed debugger
This commit is contained in:
Thaddeus Crews committed 2026-06-03 11:02:37 -05:00
commit bbd3f43b57
2 files changed
+3 -1

No files matched your search

+2 -1
View File
@@ -109,7 +109,7 @@ void EditorDebuggerSession::set_breakpoint(const String &p_path, int p_line, boo
}
void EditorDebuggerSession::detach_debugger() {
if (!debugger) {
if (!debugger || !ObjectDB::get_instance(debugger_id)) {
return;
}
debugger->disconnect("started", callable_mp(this, &EditorDebuggerSession::_started));
@@ -125,6 +125,7 @@ void EditorDebuggerSession::detach_debugger() {
EditorDebuggerSession::EditorDebuggerSession(ScriptEditorDebugger *p_debugger) {
ERR_FAIL_NULL(p_debugger);
debugger = p_debugger;
debugger_id = p_debugger->get_instance_id();
debugger->connect("started", callable_mp(this, &EditorDebuggerSession::_started));
debugger->connect("stopped", callable_mp(this, &EditorDebuggerSession::_stopped));
debugger->connect("breaked", callable_mp(this, &EditorDebuggerSession::_breaked));
+1
View File
@@ -43,6 +43,7 @@ private:
HashSet<Control *> tabs;
ScriptEditorDebugger *debugger = nullptr;
ObjectID debugger_id;
void _breaked(bool p_really_did, bool p_can_debug, const String &p_message, bool p_has_stackdump);
void _started();