summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimagepixmapcleanuphooks.cpp
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-03-04 11:06:19 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2010-03-04 11:09:47 (GMT)
commita9bf9766f18e15fbecf53ac1cc9cf57c9dba259c (patch)
treecd6b7c430b7cc1b7a50a82515414ee1c2e51dfb0 /src/gui/image/qimagepixmapcleanuphooks.cpp
parent2aaf4d1a35792ba7d0d0f217dbda1c1297389f3e (diff)
downloadQt-a9bf9766f18e15fbecf53ac1cc9cf57c9dba259c.zip
Qt-a9bf9766f18e15fbecf53ac1cc9cf57c9dba259c.tar.gz
Qt-a9bf9766f18e15fbecf53ac1cc9cf57c9dba259c.tar.bz2
Fixed an exit crash that could occur in the GL 2 engine under X11.
The global destructor for the clean up hooks might be called before the global destructor for QPixmap objects. We shouldn't leave pixmaps around that is destroyed after the QApplication destructor is called. Task-number: QTBUG-8681 Reviewed-by: Tom Cooksey
Diffstat (limited to 'src/gui/image/qimagepixmapcleanuphooks.cpp')
-rw-r--r--src/gui/image/qimagepixmapcleanuphooks.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/image/qimagepixmapcleanuphooks.cpp b/src/gui/image/qimagepixmapcleanuphooks.cpp
index 517fcb0..521e348 100644
--- a/src/gui/image/qimagepixmapcleanuphooks.cpp
+++ b/src/gui/image/qimagepixmapcleanuphooks.cpp
@@ -96,6 +96,11 @@ void QImagePixmapCleanupHooks::removeImageHook(_qt_image_cleanup_hook_64 hook)
void QImagePixmapCleanupHooks::executePixmapDataModificationHooks(QPixmapData* pmd)
{
QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();
+ // the global destructor for the pixmap and image hooks might have
+ // been called already if the app is "leaking" global
+ // pixmaps/images
+ if (!h)
+ return;
for (int i = 0; i < h->pixmapModificationHooks.count(); ++i)
h->pixmapModificationHooks[i](pmd);
@@ -106,6 +111,11 @@ void QImagePixmapCleanupHooks::executePixmapDataModificationHooks(QPixmapData* p
void QImagePixmapCleanupHooks::executePixmapDataDestructionHooks(QPixmapData* pmd)
{
QImagePixmapCleanupHooks *h = qt_image_and_pixmap_cleanup_hooks();
+ // the global destructor for the pixmap and image hooks might have
+ // been called already if the app is "leaking" global
+ // pixmaps/images
+ if (!h)
+ return;
for (int i = 0; i < h->pixmapDestructionHooks.count(); ++i)
h->pixmapDestructionHooks[i](pmd);