summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSvenn-Arne Dragly <svenn-arne.dragly@qt.io>2017-09-27 13:38:50 +0200
committerJani Heikkinen <jani.heikkinen@qt.io>2017-09-28 04:13:18 +0000
commit106061ee65e8675fbee6a1db95da855db6a16662 (patch)
treec72bd530ca0d6d857e5782cd59a7e08fa9e8674e
parent72e80520d36802672eca1e93bc6c6019e6f5ffc3 (diff)
Make m_pressAndHoldTimer into a raw pointer to avoid deleting it twice
The timer is parented to the QMouseHandler (introduced in 595b4add0ce6f32bb8ffc56b3a59e6e5bf0b000a) and was therefore deleted both by the parent and by the QScopedPointer, leading to crash on exit. This commit removes the QScopedPointer and uses a raw pointer instead. Task-number: QTBUG-63462 Change-Id: I6b031caf7cb69ccbde74995661f4ce8c73f21d88 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/input/frontend/qmousehandler.cpp2
-rw-r--r--src/input/frontend/qmousehandler_p.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/input/frontend/qmousehandler.cpp b/src/input/frontend/qmousehandler.cpp
index 9f30810a9..895cbc49a 100644
--- a/src/input/frontend/qmousehandler.cpp
+++ b/src/input/frontend/qmousehandler.cpp
@@ -60,7 +60,7 @@ QMouseHandlerPrivate::QMouseHandlerPrivate()
m_shareable = false;
m_pressAndHoldTimer->setSingleShot(true);
m_pressAndHoldTimer->setInterval(500);
- QObject::connect(m_pressAndHoldTimer.data(), &QTimer::timeout, [this] {
+ QObject::connect(m_pressAndHoldTimer, &QTimer::timeout, [this] {
emit q_func()->pressAndHold(m_lastPressedEvent.data());
});
}
diff --git a/src/input/frontend/qmousehandler_p.h b/src/input/frontend/qmousehandler_p.h
index 3b2f2284d..6c7f8b204 100644
--- a/src/input/frontend/qmousehandler_p.h
+++ b/src/input/frontend/qmousehandler_p.h
@@ -74,7 +74,7 @@ public:
QMouseDevice *m_mouseDevice;
bool m_containsMouse;
- QScopedPointer<QTimer> m_pressAndHoldTimer;
+ QTimer *m_pressAndHoldTimer = nullptr;
QMouseEventPtr m_lastPressedEvent;
void mouseEvent(const QMouseEventPtr &event);