diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-03-02 23:03:22 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-03-04 22:43:52 +0000 |
commit | 259b2b6cd76cbd86c6db1db782b5678df0686749 (patch) | |
tree | 13c71342e97264559325d935ae838dc6d04bb24a /src/plugins | |
parent | f4a8dceb6739144df0cd898759fa798044a0258c (diff) |
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>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbscreen.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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<QXcbWindow*>(window->handle()); - xcbWin->maybeSetScreen(this); + if (xcbWin) + xcbWin->maybeSetScreen(this); } } |