gui: Clear the QPixmapCache before destroying the QPlatformIntegration

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>
bb10
Holger Hans Peter Freyther 2012-04-16 16:39:44 +02:00 committed by Qt by Nokia
parent 5eaf0b8ef0
commit 6615dc1370
1 changed files with 3 additions and 0 deletions

View 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;