Fix another type of crash when dragging QDockWidget in and out

QDockWidgetPrivate::mouseMoveEvent calls q->move() which can result
in a call to QDockWidgetPrivate::endDrag(), which will delete the
state struct.  Therefore mouseMoveEvent needs to check whether it's
null or not before accessing it.

Task-number: QTBUG-31672
Change-Id: I91a31620f16a80b31b65b2742e7937ae8960f0fd
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
bb10
Shawn Rutledge 2013-06-12 15:08:28 +02:00 committed by The Qt Project
parent 443253cf11
commit b6f2442371
1 changed files with 1 additions and 1 deletions

View File

@ -873,7 +873,7 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event)
QPoint pos = event->globalPos() - state->pressPos;
q->move(pos);
if (!state->ctrlDrag)
if (state && !state->ctrlDrag)
mwlayout->hover(state->widgetItem, event->globalPos());
ret = true;