diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2016-10-11 11:35:14 +0200 |
---|---|---|
committer | Johan Helsing <johan.helsing@qt.io> | 2016-10-11 09:43:45 +0000 |
commit | 582c6a379f6a45648352c538a7df4d675c9d0a65 (patch) | |
tree | df59ae092762531912ed8fe8c63cabf006d66417 /src/client | |
parent | 0049240a2b7d8691f09224e1542919ddbbb0d864 (diff) | |
download | qtwayland-582c6a379f6a45648352c538a7df4d675c9d0a65.tar.gz |
Don't try to deliver event to destroyed window
Change-Id: If1c57250e2dc9e0d55767bbdfb15c3e3f5d9b333
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/qwaylanddatadevice.cpp | 3 | ||||
-rw-r--r-- | src/client/qwaylanddatadevice_p.h | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/client/qwaylanddatadevice.cpp b/src/client/qwaylanddatadevice.cpp index 0ff1f197..d04c20bf 100644 --- a/src/client/qwaylanddatadevice.cpp +++ b/src/client/qwaylanddatadevice.cpp @@ -183,7 +183,8 @@ void QWaylandDataDevice::data_device_enter(uint32_t serial, wl_surface *surface, void QWaylandDataDevice::data_device_leave() { - QWindowSystemInterface::handleDrag(m_dragWindow, 0, QPoint(), Qt::IgnoreAction); + if (m_dragWindow) + QWindowSystemInterface::handleDrag(m_dragWindow, 0, QPoint(), Qt::IgnoreAction); QDrag *drag = static_cast<QWaylandDrag *>(QGuiApplicationPrivate::platformIntegration()->drag())->currentDrag(); if (!drag) { diff --git a/src/client/qwaylanddatadevice_p.h b/src/client/qwaylanddatadevice_p.h index 579cb3c7..7daa9f0d 100644 --- a/src/client/qwaylanddatadevice_p.h +++ b/src/client/qwaylanddatadevice_p.h @@ -53,6 +53,7 @@ // #include <QObject> +#include <QPointer> #include <QPoint> #include <QtWaylandClient/private/qwayland-wayland.h> @@ -106,7 +107,7 @@ private: QWaylandDisplay *m_display; QWaylandInputDevice *m_inputDevice; uint32_t m_enterSerial; - QWindow *m_dragWindow; + QPointer<QWindow> m_dragWindow; QPoint m_dragPoint; QScopedPointer<QWaylandDataOffer> m_dragOffer; QScopedPointer<QWaylandDataOffer> m_selectionOffer; |