qt: fix MouseEventFilter crash on exit
The target QObject
may be destroyed before the MouseEventFilter
instance, causing a crash in MouseEventFilter::detach()
:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:524:12: runtime error: downcast of address 0x60f000114580 which does not point to an object of type 'QQuickItem'
0x60f000114580: note: object is of type 'QObject'
09 00 00 00 e0 8e ff 16 af 7f 00 00 80 a8 0c 00 a0 61 00 00 78 e8 97 18 af 7f 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QObject'
../../modules/gui/qt/util/mouse_event_filter.cpp:122:42: runtime error: member call on address 0x60f000114580 which does not point to an object of type 'QQuickItem'
0x60f000114580: note: object is of type 'QObject'
09 00 00 00 e0 8e ff 16 af 7f 00 00 80 a8 0c 00 a0 61 00 00 78 e8 97 18 af 7f 00 00 00 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'QObject'
Reset m_target
to nullptr
when the QObject
is destroyed, to avoid a
use-after-free in detach()
.
- Refs f1bda18e
- Refs 53ec7adc
- Fixes #26325 (closed)
Edited by Romain Vimont