From 25b72a63fffe800f2005b21d254b0b191d263b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Wed, 3 Aug 2016 15:20:09 +0200 Subject: [PATCH] Fix memory leak in tst_qgraphicsproxywidget QStyle was created but never removed Change-Id: I55011377afd475af28e4ce2cf657e435dd37c96a Reviewed-by: Marc Mutz Reviewed-by: Frederik Gladhorn --- .../qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index ea2599fcf9..7375513303 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -415,6 +415,7 @@ void tst_QGraphicsProxyWidget::setWidget() QGraphicsScene scene; QGraphicsView view(&scene); view.show(); + QScopedPointer style(QStyleFactory::create(QLatin1String("Fusion"))); QVERIFY(QTest::qWaitForWindowExposed(&view)); QPointer proxy = new SubQGraphicsProxyWidget; SubQGraphicsProxyWidget parentProxy; @@ -437,7 +438,7 @@ void tst_QGraphicsProxyWidget::setWidget() #endif widget->setPalette(QPalette(Qt::magenta)); widget->setLayoutDirection(Qt::RightToLeft); - widget->setStyle(QStyleFactory::create(QLatin1String("Fusion"))); + widget->setStyle(style.data()); widget->setFont(QFont("Times")); widget->setVisible(true); QApplication::setActiveWindow(widget);