diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-09-28 10:49:57 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-09-30 10:45:34 +0000 |
commit | 7d47c9736089781a2e6e4d5f71ce83e61044db1f (patch) | |
tree | 403dc558208e62b076de95b9ef2f7ea6c60865ab /tests/auto/widgets/styles | |
parent | e0e4269e289ef84433d8c10fee721a7983c180ad (diff) |
Plug remaining leaks in tests/auto/widgets/style
The usual:
- delete styles
Either by using QScopedPointer.
This fixes the remaining errors in GCC 6.1 Linux ASan runs of
tests/auto/widgets/styles.
Change-Id: Ifba59085c057d474bf964cbb93010c408d773a61
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto/widgets/styles')
-rw-r--r-- | tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index a360803c50..5da11e38ca 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -484,12 +484,12 @@ void tst_QStyleSheetStyle::widgetStyle() window1->setStyleSheet(""); // remove stylesheet QCOMPARE(window1->style(), qApp->style()); // is this cool or what QCOMPARE(widget1->style(), qApp->style()); // annoying child follows... - QStyle *wndStyle = QStyleFactory::create("Windows"); - window1->setStyle(wndStyle); + QScopedPointer<QStyle> wndStyle(QStyleFactory::create("Windows")); + window1->setStyle(wndStyle.data()); QCOMPARE(window1->style()->metaObject()->className(), "QStyleSheetStyle"); // auto wraps it QCOMPARE(widget1->style(), window1->style()); // and auto propagates to child qApp->setStyleSheet(""); // remove the app stylesheet - QCOMPARE(window1->style(), wndStyle); // auto dewrap + QCOMPARE(window1->style(), wndStyle.data()); // auto dewrap QCOMPARE(widget1->style(), qApp->style()); // and child state is restored window1->setStyle(0); // let sanity prevail qApp->setStyle(0); |