From 55ded6b2dec1ce1e36b20537eb55d73b5d98063c Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 19 Nov 2018 18:37:39 -0300 Subject: [PATCH] Properly handle multiple parent drag, fixes #19460 --- scene/main/viewport.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 86992c38f0a7e..8545efb9665b1 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1900,7 +1900,13 @@ void Viewport::_gui_input_event(Ref 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; }