Windows QPA: Potential crash fix for Wine

Add a check for theme instance.

Pick-to: 5.15
Fixes: QTBUG-85734
Change-Id: I10aced73379cd5e0b49d5cee08ceead060397a54
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This commit is contained in:
Friedemann Kleint 2020-07-27 06:17:26 +02:00
parent 37649b0942
commit beb3916858

View File

@ -569,8 +569,10 @@ bool QWindowsScreenManager::handleScreenChanges()
removeScreen(i);
} // for existing screens
} // not lock screen
if (primaryScreenChanged)
QWindowsTheme::instance()->refreshFonts();
if (primaryScreenChanged) {
if (auto theme = QWindowsTheme::instance()) // QTBUG-85734/Wine
theme->refreshFonts();
}
QHighDpiScaling::updateHighDpiScaling();
return true;
}