diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2018-05-08 08:17:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-08 08:17:24 +0200 |
commit | 6e8e401359ba86d33253fb3d3241cf09a742c8e4 (patch) | |
tree | 4d68213ae13f7292f66409c1f593b145e870a247 /scene/main | |
parent | b8087987723e5299635044b4dedcecb69426c43b (diff) | |
parent | 56c2463f8c1240fcf2376b7979991cbce3a3f1d3 (diff) |
Merge pull request #18701 from GodotExplorer/fix-#18685
Fix double free for drag preview control in viewport
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/viewport.cpp | 4 |
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; } |