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/qfbbackingstore.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/qfbbackingstore.cpp')
-rw-r--r-- | src/platformsupport/fbconvenience/qfbbackingstore.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/platformsupport/fbconvenience/qfbbackingstore.cpp b/src/platformsupport/fbconvenience/qfbbackingstore.cpp index 2a481835e2..b378434ef2 100644 --- a/src/platformsupport/fbconvenience/qfbbackingstore.cpp +++ b/src/platformsupport/fbconvenience/qfbbackingstore.cpp @@ -51,7 +51,10 @@ QT_BEGIN_NAMESPACE QFbBackingStore::QFbBackingStore(QWindow *window) : QPlatformBackingStore(window) { - (static_cast<QFbWindow *>(window->handle()))->setBackingStore(this); + if (window->handle()) + (static_cast<QFbWindow *>(window->handle()))->setBackingStore(this); + else + (static_cast<QFbScreen *>(window->screen()->handle()))->addBackingStore(this); } QFbBackingStore::~QFbBackingStore() |