Fix double free for drag preview control in viewport
This commit is contained in:
Max Hilbrunner 2018-05-08 08:17:24 +02:00 committed by GitHub
commit 6e8e401359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}