From 855a440071897f757bcd60cf39008b1e374eab06 Mon Sep 17 00:00:00 2001 From: Andrea Catania Date: Sat, 22 Sep 2018 10:14:52 +0200 Subject: Removed node from physical_bone_plugin --- editor/plugins/physical_bone_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'editor/plugins') diff --git a/editor/plugins/physical_bone_plugin.cpp b/editor/plugins/physical_bone_plugin.cpp index 1c3c000808..1b4f66d6e4 100644 --- a/editor/plugins/physical_bone_plugin.cpp +++ b/editor/plugins/physical_bone_plugin.cpp @@ -70,12 +70,14 @@ PhysicalBoneEditor::PhysicalBoneEditor(EditorNode *p_editor) : } PhysicalBoneEditor::~PhysicalBoneEditor() { - // TODO the spatial_editor_hb should be removed from SpatialEditor, but in this moment it's not possible for (int i = spatial_editor_hb->get_child_count() - 1; 0 <= i; --i) { Node *n = spatial_editor_hb->get_child(i); spatial_editor_hb->remove_child(n); memdelete(n); } + if (spatial_editor_hb->get_parent()) { + spatial_editor_hb->get_parent()->remove_child(spatial_editor_hb); + } memdelete(spatial_editor_hb); } -- cgit v1.2.3