summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap_x11.cpp
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-01-29 16:14:00 +0100
committerTrond Kjernåsen <trond@trolltech.com>2010-01-29 16:17:20 +0100
commit4a5e81f5320daa82352b13e670718998b0d2d23b (patch)
treeb803d629789df6debe937db0f681502d78aa336f /src/gui/image/qpixmap_x11.cpp
parent9e95ce2a68ef167e17dccc5789cbf3bf74712280 (diff)
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/image/qpixmap_x11.cpp')
-rw-r--r--src/gui/image/qpixmap_x11.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp
index 169a2ece26..e1e8a0db5e 100644
--- a/src/gui/image/qpixmap_x11.cpp
+++ b/src/gui/image/qpixmap_x11.cpp
@@ -1243,8 +1243,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