From 465a63d00c2294641539af820435a9a4315f0251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Arve=20S=C3=A6ther?= Date: Mon, 1 Feb 2010 09:03:48 +0100 Subject: Don't crash when running Qt on KDE with Oxygen style. It crashed on application exit because of the order of Q_GLOBAL_STATICs are not defined if the global statics are in different modules. Thus, the globalRedirectionAtomic was destroyed first, then the K_GLOBAL_STATIC(OxygenHelper, ...) got destroyed. Since the OxygeneHelper contained a QCache of pixmaps it would eventually call ~QPixmap() and reference the destroyed globalRedirectionAtomic.... Task-number: QTBUG-7734 Reviewed-by: gunnar --- src/gui/painting/qpainter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index cde6a2d..0f28f7a 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -7529,7 +7529,7 @@ QPaintDevice *QPainter::redirected(const QPaintDevice *device, QPoint *offset) void qt_painter_removePaintDevice(QPaintDevice *dev) { - if (*globalRedirectionAtomic() == 0) + if (!globalRedirectionAtomic() || *globalRedirectionAtomic() == 0) return; QMutex *mutex = 0; -- cgit v0.12