diff options
author | Jason Barron <jason.barron@nokia.com> | 2010-08-25 11:51:42 (GMT) |
---|---|---|
committer | Jason Barron <jason.barron@nokia.com> | 2010-09-10 14:48:35 (GMT) |
commit | ff98c93a33170b8fdc28b553490819b51cb80d86 (patch) | |
tree | 086db5ca87da6d580e62604702a198dfd2497c76 /src/gui/kernel | |
parent | 771cfe6f172820a1a370255cb74e066913408a6f (diff) | |
download | Qt-ff98c93a33170b8fdc28b553490819b51cb80d86.zip Qt-ff98c93a33170b8fdc28b553490819b51cb80d86.tar.gz Qt-ff98c93a33170b8fdc28b553490819b51cb80d86.tar.bz2 |
Fix crash in QRuntimeGraphicsSystem due to destruction order.
Firstly, fix a "leak" by deleting the graphics system when QApplication
is destroyed.
Secondly, fix a crash when the following scenario occurs:
- ~QApplication() deletes the current graphics system (see above)
- ~QApplication() calls qt_cleanup()
- qt_cleanup() calls QPixmapCache::clear() to delete pixmaps
- ~QRuntimePixmapData() tries to remove the pixmap from the runtime
graphics system, but it has already been deleted.
- *Crash*
Reviewed-by: Gunnar Sletta
Reviewed-by: Jani Hautakangas
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication.cpp b/src/gui/kernel/qapplication.cpp index 82dd83a..ebad56e 100644 --- a/src/gui/kernel/qapplication.cpp +++ b/src/gui/kernel/qapplication.cpp @@ -1116,6 +1116,8 @@ QApplication::~QApplication() QApplicationPrivate::app_style = 0; delete QApplicationPrivate::app_icon; QApplicationPrivate::app_icon = 0; + delete QApplicationPrivate::graphics_system; + QApplicationPrivate::graphics_system = 0; #ifndef QT_NO_CURSOR d->cursor_list.clear(); #endif |