summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>2014-02-28 16:24:32 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-04 15:59:05 +0100
commit02b18343e104512979edcc5d9ffa97cc16fe5123 (patch)
tree05569b22835889c46a55f05c8e0b52e6cd9d336a /src
parent14aae25d038d76cb650630d840fb52777f4fba25 (diff)
Fix crash in QSimpleDrag if drag wasn't started over a QWindow
The code in QSimpleDrag::startDrag() checks for the validity of the current window before passing it on to QWindowSystemInterface::handleDrag(), and so should QSimpleDrag::cancel(). Change-Id: I2228d86ede2a0b8379a55000a5c1d830cab44d45 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qsimpledrag.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qsimpledrag.cpp b/src/gui/kernel/qsimpledrag.cpp
index f6912a2d57..dcf476e4fe 100644
--- a/src/gui/kernel/qsimpledrag.cpp
+++ b/src/gui/kernel/qsimpledrag.cpp
@@ -324,9 +324,10 @@ void QSimpleDrag::startDrag()
void QSimpleDrag::cancel()
{
QBasicDrag::cancel();
- if (drag())
+ if (drag() && m_current_window) {
QWindowSystemInterface::handleDrag(m_current_window, 0, QPoint(), Qt::IgnoreAction);
- m_current_window = 0;
+ m_current_window = 0;
+ }
}
void QSimpleDrag::move(const QMouseEvent *me)