diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-24 18:29:35 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-08-25 08:36:35 (GMT) |
commit | 5e43eb85043395655155edb5206de15024e3fb71 (patch) | |
tree | 106e2dd174b2bb7972ce16aebad0a7171d941df8 /src/gui/painting | |
parent | 3636e666528b72de79f8c7012690bb9e279f0863 (diff) | |
download | Qt-5e43eb85043395655155edb5206de15024e3fb71.zip Qt-5e43eb85043395655155edb5206de15024e3fb71.tar.gz Qt-5e43eb85043395655155edb5206de15024e3fb71.tar.bz2 |
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
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qbrush.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index a52a270..b7179a4 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(); |