From f9b33f2ba7155fec0ad7def57a59505ed5504459 Mon Sep 17 00:00:00 2001 From: IChooseYou Date: Sun, 15 Feb 2026 13:53:59 -0700 Subject: [PATCH] fix: options dialog test segfault from dangling ref to themes() temporary --- tests/test_options_dialog.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/test_options_dialog.cpp b/tests/test_options_dialog.cpp index de82ac5..9aaf100 100644 --- a/tests/test_options_dialog.cpp +++ b/tests/test_options_dialog.cpp @@ -132,9 +132,8 @@ private slots: // Verify the palette Highlight is distinguishable from Window background // This is the root cause of broken hover: if they're the same, hover is invisible auto& tm = ThemeManager::instance(); - for (int i = 0; i < tm.themes().size(); ++i) { - const auto& theme = tm.themes()[i]; - // selection must differ from background + const auto themes = tm.themes(); + for (const auto& theme : themes) { QVERIFY2(theme.selection != theme.background, qPrintable(QString("Theme '%1': selection == background (%2)") .arg(theme.name, theme.background.name())));