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/image/qpixmap_x11.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/image/qpixmap_x11.cpp')
-rw-r--r-- | src/gui/image/qpixmap_x11.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 169a2ec..e1e8a0d 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 |