From 259b2b6cd76cbd86c6db1db782b5678df0686749 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 2 Mar 2015 23:03:22 -0800 Subject: 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 --- src/plugins/platforms/xcb/qxcbscreen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index 58a364848a..78ced43af8 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -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(window->handle()); - xcbWin->maybeSetScreen(this); + if (xcbWin) + xcbWin->maybeSetScreen(this); } } -- cgit v1.2.3