Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.12.3
-
None
-
-
7d73d4b9a93b3132c1a24aa3ae77f0a307e821fd (qt/qtbase/5.13) d1b009cbbb06716a6c953184380c84e1cb4fbbf1 (qt/qtbase/5.12)
Description
When unregistering Qt-GestureRecognizers, e.g. with
QGestureRecognizer::unregisterRecognizer(Qt::PanGesture);
the recognizers are not completely released. They are just moved to
m_deletedRecognizers/m_obsoleteGestures. Thus is not a problem - yet. Probably the bug could be there.
After this, destroying the QApplication (and implicitly the QGestureManager), it causes them to
delete the object of recognizers _before_ it can be delete the obsolete ones.
See qgesturemanager.cpp:
QGestureManager::~QGestureManager() { qDeleteAll(m_recognizers); // ^--^ implies deleting the Keys used in m_obsoleteGestures. foreach (QGestureRecognizer *recognizer, m_obsoleteGestures.keys()) { // does not crash, but the value is no longer valid qDeleteAll(m_obsoleteGestures.value(recognizer)); delete recognizer; // Access violation now } m_obsoleteGestures.clear(); }
Where is the error?
Problem should be reproducible with the smallest Qt-Example and did not appear in Qt 5.9.