fix: options dialog test segfault from dangling ref to themes() temporary

This commit is contained in:
IChooseYou
2026-02-15 13:53:59 -07:00
parent f2dab07870
commit f9b33f2ba7

View File

@@ -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())));