summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSérgio Martins <sergio.martins@kdab.com>2012-10-22 00:55:04 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-25 14:10:04 +0200
commit6e908f09dfc19be3cbbf38628c63c348c5172e53 (patch)
treefb1c2d1a73bdd4afb3b4470bfec7dee2c4e690c2
parent92c739cf50b18b8abdc1b30480b75cc6b27cf5bf (diff)
Don't crash if there's no m_image yet.
Reproducible with: QBackingStore store( &window ); store.beginPaint(QRect(0,0,500,500)); All other methods already have null pointer checks. Change-Id: Ie278a263760900b58cf4a2ef286deb7f35d50cd0 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index 847fd67047..649469ab9d 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -262,11 +262,14 @@ QXcbBackingStore::~QXcbBackingStore()
QPaintDevice *QXcbBackingStore::paintDevice()
{
- return m_image->image();
+ return m_image ? m_image->image() : 0;
}
void QXcbBackingStore::beginPaint(const QRegion &region)
{
+ if (!m_image)
+ return;
+
m_image->preparePaint(region);
#if 0