From 5e43eb85043395655155edb5206de15024e3fb71 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 24 Aug 2009 20:29:35 +0200 Subject: Memory leak in QBrush QScopedPointer would not cleanup the old object if it is the same as the new one. But operator= does increment the reference count even if they were the same Reviewed-by: Harald Fernengel --- src/gui/painting/qbrush.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index a52a270ac..b7179a422 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -625,7 +625,7 @@ void QBrush::detach(Qt::BrushStyle newStyle) QBrush &QBrush::operator=(const QBrush &b) { - if (this == &b) + if (d == b.d) return *this; b.d->ref.ref(); -- cgit v1.2.3