diff options
author | marynate <mary.w.nate@gmail.com> | 2014-04-03 01:28:16 +0800 |
---|---|---|
committer | marynate <mary.w.nate@gmail.com> | 2014-04-03 16:36:01 +0800 |
commit | f07a377624062caff6290898eff663cb479d277e (patch) | |
tree | 4021f187a8745a4e6eb851c6dbde2f07935167d8 /tools/editor | |
parent | 3b3c4b7585867961591567e2d83e8aef27776d91 (diff) |
Fixed delete path2d node will crash editor
Diffstat (limited to 'tools/editor')
-rw-r--r-- | tools/editor/plugins/path_2d_editor_plugin.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/editor/plugins/path_2d_editor_plugin.cpp b/tools/editor/plugins/path_2d_editor_plugin.cpp index cb15157aa8..341a17ab25 100644 --- a/tools/editor/plugins/path_2d_editor_plugin.cpp +++ b/tools/editor/plugins/path_2d_editor_plugin.cpp @@ -516,7 +516,6 @@ void Path2DEditor::_node_visibility_changed() { return; canvas_item_editor->get_viewport_control()->update(); - } void Path2DEditor::edit(Node *p_path2d) { @@ -533,15 +532,15 @@ void Path2DEditor::edit(Node *p_path2d) { if (!node->is_connected("visibility_changed", this, "_node_visibility_changed")) node->connect("visibility_changed", this, "_node_visibility_changed"); - } else { if (canvas_item_editor->get_viewport_control()->is_connected("draw",this,"_canvas_draw")) canvas_item_editor->get_viewport_control()->disconnect("draw",this,"_canvas_draw"); - if (node->is_connected("visibility_changed", this, "_node_visibility_changed")) + + // node may have been deleted at this point + if (node && node->is_connected("visibility_changed", this, "_node_visibility_changed")) node->disconnect("visibility_changed", this, "_node_visibility_changed"); node=NULL; - } } |