diff options
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r-- | editor/editor_inspector.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index 50cc89c618..98feba38fd 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -3477,7 +3477,9 @@ void EditorInspector::edit(Object *p_object) { next_object = p_object; // Some plugins need to know the next edited object when clearing the inspector. if (object) { _clear(); - object->disconnect("property_list_changed", callable_mp(this, &EditorInspector::_changed_callback)); + if (object->is_connected("property_list_changed", callable_mp(this, &EditorInspector::_changed_callback))) { + object->disconnect("property_list_changed", callable_mp(this, &EditorInspector::_changed_callback)); + } } per_array_page.clear(); @@ -4019,14 +4021,13 @@ void EditorInspector::_notification(int p_what) { } break; case NOTIFICATION_PREDELETE: { - edit(nullptr); //just in case + edit(nullptr); } break; case NOTIFICATION_EXIT_TREE: { if (!sub_inspector) { get_tree()->disconnect("node_removed", callable_mp(this, &EditorInspector::_node_removed)); } - edit(nullptr); } break; case NOTIFICATION_VISIBILITY_CHANGED: { |