gui: Clear the QPixmapCache before destroying the QPlatformIntegration
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>
Mon, 16 Apr 2012 14:39:44 +0000 (16:39 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 16 Apr 2012 16:15:00 +0000 (18:15 +0200)
The QPixmap in the pixmap cache should not outlive the QPlatformIntegration.
Clear the cache shortly before destroying the platform integration. This is
fixing a crash with the DirectFB plugin in the tst_qpixmapcache test.

Change-Id: I0b1a304dc37d874b412aadb77f8dbaa7d292711f
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
src/gui/kernel/qguiapplication.cpp

index 8dcd58a..0eb53df 100644 (file)
@@ -68,6 +68,7 @@
 #include <QtGui/QGenericPluginFactory>
 #include <QtGui/qstylehints.h>
 #include <QtGui/qinputpanel.h>
+#include <QtGui/qpixmapcache.h>
 #include <QtGui/qplatformtheme_qpa.h>
 #include <QtGui/qplatforminputcontext_qpa.h>
 #include <private/qplatforminputcontext_qpa_p.h>
@@ -892,6 +893,8 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate()
 
     qt_cleanupFontDatabase();
 
+    QPixmapCache::clear();
+
     delete  platform_theme;
     delete platform_integration;
     platform_integration = 0;