XCB: Solve crash when plugging a screen with unshown QWindow
If a QWindow has never been shown, it has no platformWindow (it's null). So it's a valid condition and we need to be sure that the pointer isn't null before dereferencing it. Task-number: QTBUG-44766 Change-Id: Ia0aac2f09e9245339951ffff13c7eb024d6a0773 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
parent
f4a8dceb67
commit
259b2b6cd7
@ -399,7 +399,8 @@ void QXcbScreen::handleScreenChange(xcb_randr_screen_change_notify_event_t *chan
|
||||
// They need to be told the screen is back, it's OK to render.
|
||||
foreach (QWindow *window, QGuiApplication::topLevelWindows()) {
|
||||
QXcbWindow *xcbWin = static_cast<QXcbWindow*>(window->handle());
|
||||
xcbWin->maybeSetScreen(this);
|
||||
if (xcbWin)
|
||||
xcbWin->maybeSetScreen(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user