From 46ec93d3ff9653c7240ccba995eeef7298b479ec Mon Sep 17 00:00:00 2001 From: Jan-Arve Saether Date: Wed, 7 Sep 2011 09:48:50 +0200 Subject: [PATCH] Do not leak memory Task-number: QT-4333 Change-Id: Idadb3eec3ac1b8775017ead6deff38e22d5b04b2 Reviewed-on: http://codereview.qt.nokia.com/4323 Reviewed-by: Qt Sanity Bot Reviewed-by: Richard Moe Gustavsen --- src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp index ff4bf84..c9bda58 100644 --- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp +++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.cpp @@ -2966,11 +2966,12 @@ bool QGraphicsAnchorLayoutPrivate::solvePreferred(const QListsizeAtPreferred = ad->result - g_offset; } - - // Make sure we delete the simplex solver -before- we delete the - // constraints used by it. - delete simplex; } + + // Make sure we delete the simplex solver -before- we delete the + // constraints used by it. + delete simplex; + // Delete constraints and variables we created. qDeleteAll(preferredConstraints); qDeleteAll(preferredVariables); -- 2.7.4