diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2010-01-29 15:14:00 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond@trolltech.com> | 2010-01-29 15:17:20 (GMT) |
commit | 4a5e81f5320daa82352b13e670718998b0d2d23b (patch) | |
tree | b803d629789df6debe937db0f681502d78aa336f /src/gui/painting/qpainter.cpp | |
parent | 9e95ce2a68ef167e17dccc5789cbf3bf74712280 (diff) | |
download | Qt-4a5e81f5320daa82352b13e670718998b0d2d23b.zip Qt-4a5e81f5320daa82352b13e670718998b0d2d23b.tar.gz Qt-4a5e81f5320daa82352b13e670718998b0d2d23b.tar.bz2 |
Fixed a crash when QPixmaps are destroyed after the ~QApplication.
Destroying QPixmaps after the QApp destructor will leak native pixmap
objects on X11, and it's a general rule that all GUI objects must
be destroyed before the QApp destuctor is called.
Task-number: QTBUG-7746
Reviewed-by: Kim
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index cde6a2d..bf12c6b 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; |