summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorGeequlim <geequlim@gmail.com>2018-05-08 13:52:38 +0800
committerGeequlim <geequlim@gmail.com>2018-05-08 13:52:38 +0800
commit56c2463f8c1240fcf2376b7979991cbce3a3f1d3 (patch)
tree380cd21928f8f668749c54a12e15c625d746a939 /scene/main
parentbdad359d99c2c139723b2ea0f3ea76e550d68bfa (diff)
Fix double free for drag preview control in viewport
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/viewport.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 11b663e413..9a9a19ed1a 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -2168,9 +2168,7 @@ void Viewport::_gui_set_drag_preview(Control *p_base, Control *p_control) {
p_control->set_position(gui.last_mouse_pos);
p_base->get_root_parent_control()->add_child(p_control); //add as child of viewport
p_control->raise();
- if (gui.drag_preview) {
- memdelete(gui.drag_preview);
- }
+
gui.drag_preview = p_control;
}