Windows: Destroy tablet support before unregistering window classes.
Silences warnings in tests that instantiate QGuiApplication multiple times. QSYSTEM: tst_QGuiApplication::removePostedEvents() QApplication::regClass: Registering window class 'TabletDummyWindow' failed. (Class already exists.) QSYSTEM: tst_QGuiApplication::removePostedEvents() UnregisterClass failed for 'TabletDummyWindow' (Class still has open windows.) Change-Id: I6af2d38a2debd35f4dc0d48c09244dff022bd6b8 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
This commit is contained in:
parent
03aabe6c6e
commit
e8ba6922c3
@ -330,6 +330,9 @@ QWindowsContext::QWindowsContext() :
|
|||||||
|
|
||||||
QWindowsContext::~QWindowsContext()
|
QWindowsContext::~QWindowsContext()
|
||||||
{
|
{
|
||||||
|
#if !defined(QT_NO_TABLETEVENT) && !defined(Q_OS_WINCE)
|
||||||
|
d->m_tabletSupport.reset(); // Destroy internal window before unregistering classes.
|
||||||
|
#endif
|
||||||
unregisterWindowClasses();
|
unregisterWindowClasses();
|
||||||
if (d->m_oleInitializeResult == S_OK || d->m_oleInitializeResult == S_FALSE)
|
if (d->m_oleInitializeResult == S_OK || d->m_oleInitializeResult == S_FALSE)
|
||||||
OleUninitialize();
|
OleUninitialize();
|
||||||
@ -517,8 +520,10 @@ void QWindowsContext::unregisterWindowClasses()
|
|||||||
{
|
{
|
||||||
const HINSTANCE appInstance = (HINSTANCE)GetModuleHandle(0);
|
const HINSTANCE appInstance = (HINSTANCE)GetModuleHandle(0);
|
||||||
|
|
||||||
foreach (const QString &name, d->m_registeredWindowClassNames)
|
foreach (const QString &name, d->m_registeredWindowClassNames) {
|
||||||
UnregisterClass((wchar_t*)name.utf16(), appInstance);
|
if (!UnregisterClass((wchar_t*)name.utf16(), appInstance) && QWindowsContext::verbose)
|
||||||
|
qErrnoWarning("UnregisterClass failed for '%s'", qPrintable(name));
|
||||||
|
}
|
||||||
d->m_registeredWindowClassNames.clear();
|
d->m_registeredWindowClassNames.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user