diff -r 56cd8111b7f7 -r 41300fa6a67c src/gui/painting/qwindowsurface_x11.cpp --- a/src/gui/painting/qwindowsurface_x11.cpp Tue Jan 26 12:42:25 2010 +0200 +++ b/src/gui/painting/qwindowsurface_x11.cpp Tue Feb 02 00:43:10 2010 +0200 @@ -94,6 +94,8 @@ 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(d_ptr->device.data_ptr().data())->convertToARGB32(); @@ -157,8 +159,8 @@ QPixmap::x11SetDefaultScreen(d_ptr->widget->x11Info().screen()); QX11PixmapData *oldData = static_cast(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());