diff options
author | Paul Olav Tvete <paul.tvete@digia.com> | 2013-05-16 14:28:07 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-22 15:20:18 +0200 |
commit | 3c50917a6ac1ee7fd4707d69a8ca186343c21f91 (patch) | |
tree | a66d2b91c1a3e92f86b9b9a51435951245711e35 /src/platformsupport/fbconvenience/qfbscreen.cpp | |
parent | 18db71d601f7164e4120ae94277fe9faa398abe6 (diff) |
Android: Fix crash when using QBackingStore
When making a QBackingStore for a QWindow that was not created yet,
Qt would try to dereference the (null) platform window pointer.
Task-number: QTBUG-31022
Change-Id: I866c71cce9d401ebb598ea4cc91f7cf9bbb30982
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Diffstat (limited to 'src/platformsupport/fbconvenience/qfbscreen.cpp')
-rw-r--r-- | src/platformsupport/fbconvenience/qfbscreen.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/platformsupport/fbconvenience/qfbscreen.cpp b/src/platformsupport/fbconvenience/qfbscreen.cpp index 6427b62972..e5b9f09c14 100644 --- a/src/platformsupport/fbconvenience/qfbscreen.cpp +++ b/src/platformsupport/fbconvenience/qfbscreen.cpp @@ -71,6 +71,19 @@ void QFbScreen::initializeCompositor() void QFbScreen::addWindow(QFbWindow *window) { mWindowStack.prepend(window); + if (!mBackingStores.isEmpty()) { + //check if we have a backing store for this window + for (int i = 0; i < mBackingStores.size(); ++i) { + QFbBackingStore *bs = mBackingStores.at(i); + // this gets called during QWindow::create() at a point where the + // invariant (window->handle()->window() == window) is broken + if (bs->window() == window->window()) { + window->setBackingStore(bs); + mBackingStores.removeAt(i); + break; + } + } + } invalidateRectCache(); setDirty(window->geometry()); QWindow *w = topWindow(); |