summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-11-02 09:51:08 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-11-02 09:51:08 (GMT)
commit17cda5c55273813cbedcced3a511f1c222978182 (patch)
treea7982926151c358e4e62b3de404874759a34cd33 /src
parent0e02c54e7e56ee091aeeb6342faa2df163fbbd74 (diff)
downloadQt-17cda5c55273813cbedcced3a511f1c222978182.zip
Qt-17cda5c55273813cbedcced3a511f1c222978182.tar.gz
Qt-17cda5c55273813cbedcced3a511f1c222978182.tar.bz2
Check for null pixmap
Reviewed-by: Trond
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qwindowsurface_x11.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/painting/qwindowsurface_x11.cpp b/src/gui/painting/qwindowsurface_x11.cpp
index 46c4c42..77e019c 100644
--- a/src/gui/painting/qwindowsurface_x11.cpp
+++ b/src/gui/painting/qwindowsurface_x11.cpp
@@ -94,6 +94,8 @@ QPaintDevice *QX11WindowSurface::paintDevice()
void QX11WindowSurface::beginPaint(const QRegion &rgn)
{
#ifndef QT_NO_XRENDER
+ Q_ASSERT(!d_ptr->device.isNull());
+
if (d_ptr->translucentBackground) {
if (d_ptr->device.depth() != 32)
static_cast<QX11PixmapData *>(d_ptr->device.data_ptr().data())->convertToARGB32();
@@ -157,8 +159,8 @@ void QX11WindowSurface::setGeometry(const QRect &rect)
QPixmap::x11SetDefaultScreen(d_ptr->widget->x11Info().screen());
QX11PixmapData *oldData = static_cast<QX11PixmapData *>(d_ptr->device.pixmapData());
- Q_ASSERT(oldData);
- if (!(oldData->flags & QX11PixmapData::Uninitialized) && hasStaticContents()) {
+
+ if (oldData && !(oldData->flags & QX11PixmapData::Uninitialized) && hasStaticContents()) {
// Copy the content of the old pixmap into the new one.
QX11PixmapData *newData = new QX11PixmapData(QPixmapData::PixmapType);
newData->resize(size.width(), size.height());