Android: Don't crash if the screen is not yet initialized.

Change-Id: I4751c2dec5780f42b348a8a8ea628f65d548dcec
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
This commit is contained in:
BogDan Vatra 2013-10-27 10:20:32 +02:00 committed by The Qt Project
parent 8d1ab25ed2
commit 684a952edb

View File

@ -559,8 +559,10 @@ static void setSurface(JNIEnv *env, jobject /*thiz*/, jobject jSurface)
QPlatformScreen *screen = m_androidPlatformIntegration->screen(); QPlatformScreen *screen = m_androidPlatformIntegration->screen();
QRect geometry(QPoint(0, 0), size); QRect geometry(QPoint(0, 0), size);
QWindowSystemInterface::handleScreenAvailableGeometryChange(screen->screen(), geometry); if (screen) {
QWindowSystemInterface::handleScreenGeometryChange(screen->screen(), geometry); QWindowSystemInterface::handleScreenAvailableGeometryChange(screen->screen(), geometry);
QWindowSystemInterface::handleScreenGeometryChange(screen->screen(), geometry);
}
if (!sameNativeWindow) { if (!sameNativeWindow) {
m_surfaceMutex.unlock(); m_surfaceMutex.unlock();