Fix editor crash while exiting debuggger

This commit is contained in:
geequlim 2017-07-15 18:31:21 +08:00
parent cf52c63034
commit 7a02467dad
1 changed files with 8 additions and 3 deletions

View File

@ -1675,7 +1675,10 @@ void ScriptEditorDebugger::_set_remote_object(ObjectID p_id, ScriptEditorDebugge
void ScriptEditorDebugger::_clear_remote_objects() { void ScriptEditorDebugger::_clear_remote_objects() {
if (inspector)
inspector->edit(NULL); inspector->edit(NULL);
if (inspect_properties)
inspect_properties->edit(NULL); inspect_properties->edit(NULL);
for (Map<ObjectID, ScriptEditorDebuggerInspectedObject *>::Element *E = remote_objects.front(); E; E = E->next()) { for (Map<ObjectID, ScriptEditorDebuggerInspectedObject *>::Element *E = remote_objects.front(); E; E = E->next()) {
@ -2024,9 +2027,11 @@ ScriptEditorDebugger::~ScriptEditorDebugger() {
// inspector->edit(NULL); // inspector->edit(NULL);
memdelete(variables); memdelete(variables);
ppeer->set_stream_peer(Ref<StreamPeer>()); ppeer->set_stream_peer(Ref<StreamPeer>());
inspector = NULL;
inspect_properties = NULL;
server->stop(); server->stop();
_clear_remote_objects(); _clear_remote_objects();
} }