GUI: no need to unregister input device if list is destroyed

Fixes: QTBUG-133776
Pick-to: 6.9 6.8
Change-Id: If4a148e3ebf753ccd661a5ed1b321dbd7751576e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
Thiago Macieira 2025-02-17 20:16:55 +01:00 committed by Liang Qi
parent 2753924fcb
commit 1040728e39

View File

@ -356,6 +356,9 @@ void QInputDevicePrivate::registerDevice(const QInputDevice *dev)
*/
void QInputDevicePrivate::unregisterDevice(const QInputDevice *dev)
{
if (deviceList.isDestroyed())
return; // nothing to remove!
QMutexLocker lock(&devicesMutex);
deviceList()->removeOne(dev);
qCInfo(lcQpaInputDevices) << "Unregistered" << dev;