summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <[email protected]>2025-03-22 10:01:38 +0100
committerMarc Mutz <[email protected]>2025-03-23 16:49:26 +0000
commit5be58ac9271555eed3a2884d827f30c164d2277d (patch)
tree72160e66a908e99e515bda14ad40fafd350038ec /src
parent2428cbf44e3e2aa4eaf00c9548ac5a74685101c4 (diff)
tst_QWidget: don't leak QStyle objects
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. Pick-to: 6.9 Change-Id: Ie9e7faf21bc177e08af56c659dc58870ad3cf6ff Reviewed-by: Volker Hilsheimer <[email protected]>
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions