The result of QStyleFactory::create() must be deleted by the caller. Some test functions stored it in a QScopedPointer, while others didn't, each causing a leak of a QWindowsStyle object. DRY the test functions (except the one that checks that 'delete widget.style();' works) by introducing an owning pointer at the test class level, to be reused by test functions. This is not so much for caching the object across test functions (though this is a nice benefit, too), but in order to keep the owning pointer out of the test functions, and allow most functions to just do setStyle(deterministicStyle()). Found by ASAN. On my machine, this test is now ASAN-clean, except a) the usual cp-demangle.c leak and b) destroyedSignal(), which still leaks. As a drive-by, pass a QStringLiteral instead of QL1SV to QStyleFactory::create() and port one QVERIFY( != ) to QCOMPARE_NE(). No amends, it'd be too many. Not picking back far, because others don't care, and I expect lots of conflicts when backporting, due to many different amended commits. Change-Id: Ie9e7faf21bc177e08af56c659dc58870ad3cf6ff Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 5be58ac9271555eed3a2884d827f30c164d2277d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%