Properly handle multiple parent drag, fixes #19460

This commit is contained in:
Juan Linietsky 2018-11-19 18:37:39 -03:00
parent 35fbbeb99b
commit 55ded6b2de

View file

@ -1900,7 +1900,13 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
if (gui.drag_data.get_type() != Variant::NIL) {
gui.mouse_focus = NULL;
break;
} else {
if (gui.drag_preview != NULL) {
ERR_PRINT("Don't set a drag preview and return null data. Preview was deleted and drag request ignored.");
memdelete(gui.drag_preview);
gui.drag_preview = NULL;
}
gui.dragging = false;
}