From fbe103bd39fcef2b873aae31dcfee9604237a95e Mon Sep 17 00:00:00 2001 From: Leonardo Sobral Cunha Date: Thu, 30 Jul 2009 12:23:49 +0200 Subject: Revert "Avoids comparing a pointer (d->layout) after deleted in qgraphicswidget" This reverts commit e181f8754bccb13cb59212f279e05c20cb76db62. This code is used for compatibility issues for custom layouts that dont delete their children, so its a false positive from coverity. --- src/gui/graphicsview/qgraphicswidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index cb8336d..3ea80ce 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -258,6 +258,7 @@ QGraphicsWidget::~QGraphicsWidget() //we check if we have a layout previously if (d->layout) { + delete d->layout; foreach (QGraphicsItem * item, childItems()) { // In case of a custom layout which doesn't remove and delete items, we ensure that // the parent layout item does not point to the deleted layout. This code is here to @@ -268,7 +269,6 @@ QGraphicsWidget::~QGraphicsWidget() widget->setParentLayoutItem(0); } } - delete d->layout; } // Remove this graphics widget from widgetStyles -- cgit v0.12