From 0d1024e0f147f033e481450e4b1cf918ddb7e735 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 3 Dec 2015 13:49:33 +0100 Subject: [PATCH] QMdiArea: fix unintended reallocations The capacity of 'result' is reserved, but QVector::clear() always deallocates. Fix by using resize(int) instead, which at least preserves capacity when it has been reserve()d. Change-Id: I198d532661f4f767588c4ce244c2454eb8823e54 Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qmdiarea.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp index 55ae866358..7ed790e40f 100644 --- a/src/widgets/widgets/qmdiarea.cpp +++ b/src/widgets/widgets/qmdiarea.cpp @@ -512,7 +512,7 @@ QVector MinOverlapPlacer::findMaxOverlappers(const QRect &domain, const Q if (overlap >= maxOverlap || maxOverlap == -1) { if (overlap > maxOverlap) { maxOverlap = overlap; - result.clear(); + result.resize(0); } result << srcRect; }