[XCB] Fix crash in QML drag-and-drop

Use QPointer to make sure that we are not trying to destroy already
deleted object.

Task-number: QTBUG-35702

Change-Id: Ib746996787488e636f25e6ea5be0571607ee2ded
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Gatis Paeglis 2014-03-12 15:50:36 +01:00 committed by The Qt Project
parent df757e30f8
commit 530f985651
2 changed files with 3 additions and 2 deletions

View File

@ -1044,7 +1044,8 @@ void QXcbDrag::timerEvent(QTimerEvent* e)
- showing dialog box on drop event where user's response takes more time than XdndDropTransactionTimeout (QTBUG-14493)
- dnd takes unusually long time to process data
*/
t.drag->deleteLater();
if (t.drag)
t.drag->deleteLater();
transactions.removeAt(i--);
} else {
stopTimer = false;

View File

@ -157,7 +157,7 @@ private:
xcb_window_t proxy_target;
QWindow *targetWindow;
// QWidget *embedding_widget;
QDrag *drag;
QPointer<QDrag> drag;
QTime time;
};
QList<Transaction> transactions;