Qt invalid cast

While exiting the Qt GUI:

../../modules/gui/qt/util/mouse_event_filter.cpp:122:42: runtime error: member call on address 0x60f00006f850 which does not point to an object of type 'QQuickItem'