Delete QInputDeviceManager when deleting QGuiApplication

Without deleting m_inputDeviceManager instance it will remain
in process and causes crash when creating+destroying QGuiApplication
multiple times in process. Crash happens because m_inputDeviceManager
already exists when creating new instance of QGuiApplication and
metadata for QInputDeviceManager is not anymore valid and crash when
accessing it e.g. using connect() function.

Change-Id: I5acb1c5f6ce2ba9665fa893047210a913debe4e4
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
This commit is contained in:
Pasi Petäjäjärvi 2015-11-12 16:23:42 +02:00
parent e8eaf82e58
commit 7ac5228144

View File

@ -603,6 +603,8 @@ QGuiApplication::~QGuiApplication()
QGuiApplicationPrivate::platform_name = 0; QGuiApplicationPrivate::platform_name = 0;
delete QGuiApplicationPrivate::displayName; delete QGuiApplicationPrivate::displayName;
QGuiApplicationPrivate::displayName = 0; QGuiApplicationPrivate::displayName = 0;
delete QGuiApplicationPrivate::m_inputDeviceManager;
QGuiApplicationPrivate::m_inputDeviceManager = 0;
} }
QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags) QGuiApplicationPrivate::QGuiApplicationPrivate(int &argc, char **argv, int flags)