diff options
-rw-r--r-- | src/gui/image/qpixmap_x11.cpp | 7 | ||||
-rw-r--r-- | src/gui/painting/qpainter.cpp | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 7a430af..1e5f3f9 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -1236,8 +1236,13 @@ void QX11PixmapData::release() delete pengine; pengine = 0; - if (!X11) + if (!X11) { +#ifndef QT_NO_DEBUG + qWarning("~QX11PixmapData(): QPixmap objects must be destroyed before the QApplication" + " object, otherwise the native pixmap object will be leaked."); +#endif return; + } if (x11_mask) { #ifndef QT_NO_XRENDER diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index fbd6451..51b1164 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7509,7 +7509,7 @@ QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset) return widgetPrivate->redirected(offset); } - if (*globalRedirectionAtomic() == 0) + if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0) return 0; QMutexLocker locker(globalRedirectionsMutex()); @@ -7529,7 +7529,7 @@ QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset) void qt_painter_removePaintDevice(QPaintDevice *dev) { - if (*globalRedirectionAtomic() == 0) + if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0) return; QMutex *mutex = 0; |