diff options
author | Juan Linietsky <reduzio@gmail.com> | 2018-11-19 18:37:39 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2018-11-19 18:38:07 -0300 |
commit | 55ded6b2dec1ce1e36b20537eb55d73b5d98063c (patch) | |
tree | 0cf8a8ef6cb7adb223c7000286bbf599d4046407 | |
parent | 35fbbeb99b3b2356ea86572f9c9f26c2523fcc8e (diff) |
Properly handle multiple parent drag, fixes #19460
-rw-r--r-- | scene/main/viewport.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 86992c38f0..8545efb966 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -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; } |