summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-08-10 17:43:12 +0200
committerLiang Qi <liang.qi@qt.io>2016-08-10 17:43:13 +0200
commit8ba384a5645aebbefe34b814828024d511171497 (patch)
tree6f6cfe1b849b6e0e02de15ee74ad0f3d5fc740b6 /src/platformsupport/input
parente694ced803589b3504b6bdb2fc8bf97bc891c794 (diff)
parent25b72a63fffe800f2005b21d254b0b191d263b10 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'src/platformsupport/input')
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
index 6b98ed30a9..435f411f96 100644
--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
+++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp
@@ -400,9 +400,13 @@ void QEvdevTouchScreenHandler::unregisterTouchDevice()
if (!m_device)
return;
- QWindowSystemInterface::unregisterTouchDevice(m_device);
+ // At app exit the cleanup may have already been done, avoid
+ // double delete by checking the list first.
+ if (QWindowSystemInterface::isTouchDeviceRegistered(m_device)) {
+ QWindowSystemInterface::unregisterTouchDevice(m_device);
+ delete m_device;
+ }
- delete m_device;
m_device = Q_NULLPTR;
}