summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2010-03-09 16:16:02 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2010-03-09 16:16:02 (GMT)
commit95dd8a45b0da50fb32843dd275b2028ce77b2492 (patch)
tree6027aa32ceb167cb2940f7308e9cdc74053dfc82 /src/gui/text
parent42b69b1383375a52818758bf89198e8dc97902d3 (diff)
downloadQt-95dd8a45b0da50fb32843dd275b2028ce77b2492.zip
Qt-95dd8a45b0da50fb32843dd275b2028ce77b2492.tar.gz
Qt-95dd8a45b0da50fb32843dd275b2028ce77b2492.tar.bz2
Memory leak!
Multiple insertions of the same (key, value) pair in a QMultiHash. Reviewed-by: Olivier Task-number: QTBUG-8862
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextformat.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index dca2da5..140cf43 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -3085,7 +3085,8 @@ int QTextFormatCollection::indexForFormat(const QTextFormat &format)
f.d = new QTextFormatPrivate;
f.d->resolveFont(defaultFnt);
- hashes.insert(hash, idx);
+ if (!hashes.contains(hash, idx))
+ hashes.insert(hash, idx);
} QT_CATCH(...) {
formats.pop_back();