From 73acd7beb8e78274341b3c28bf04cfb8be569b80 Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Thu, 27 Nov 2025 12:09:16 -0500 Subject: [PATCH] Fix resource leak (coverity) --- src/autotests/ProfileTest.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/autotests/ProfileTest.cpp b/src/autotests/ProfileTest.cpp index 37b382f62..0d3f03745 100644 --- a/src/autotests/ProfileTest.cpp +++ b/src/autotests/ProfileTest.cpp @@ -38,7 +38,7 @@ void ProfileTest::initTestCase() void ProfileTest::testProfile() { // create a new profile - Profile *parent = new Profile; + Profile::Ptr parent(new Profile); parent->setProperty(Profile::Name, QStringLiteral("Parent")); parent->setProperty(Profile::Path, QStringLiteral("FakePath")); @@ -55,7 +55,7 @@ void ProfileTest::testProfile() QCOMPARE(parent->customCursorTextColor(), QColor()); // create a child profile - Profile *child = new Profile(Profile::Ptr(parent)); + Profile::Ptr child(new Profile(parent)); child->setProperty(Profile::StartInCurrentSessionDir, true); // check which properties are set @@ -84,7 +84,7 @@ void ProfileTest::testProfile() QVERIFY(!parent->startInCurrentSessionDir()); QVERIFY(child->startInCurrentSessionDir()); - delete child; + Q_UNUSED(child); } void ProfileTest::testClone()