From 29b2267711ea20faa56321c6d74582b3b57c5743 Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 9 Jun 2022 21:01:58 +0200 Subject: [PATCH] Fix invalid use of freed object in settings dialog test --- tests/dialogs.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/dialogs.cpp b/tests/dialogs.cpp index eaac8a6..ab6d08d 100644 --- a/tests/dialogs.cpp +++ b/tests/dialogs.cpp @@ -25,6 +25,7 @@ void DialogsTests::testSettingsDialog() auto *const testCategory = new OptionCategory(); testCategory->setDisplayName(QStringLiteral("Test category")); testCategory->setIcon(QIcon::fromTheme(QStringLiteral("preferences"))); + settingsDlg.showCategory(nullptr); // ensure no current category is shown anymore settingsDlg.setSingleCategory(nullptr); auto *const qtCategory = qtSettings.category(); settingsDlg.categoryModel()->setCategories(QList({testCategory, qtCategory}));