Am Freitag, dem 26.12.2025 um 15:09 +0300 schrieb Baris Erkus:
> This is exactly what was happening in my case. I was using a theme
> where the OS (Windows 10) background picture and colors change
> automatically every 3 hrs. Initially, I could not figure out that the
> freeze+memory leak is caused by the MS Windows background and color
> changes. Then, just by chance, I was able reproduce the leak, when I
> change the MS Windows theme color manually. I think you can also re-
> generate it easily: Open LyX. Go to Windows settings. Go to Themes.
> Change the color of the theme. Observe LyX and memory usage from Task
> Manager.
This probably happens in the wake of the QEvent::ThemeChange signal.
I cannot test myself (not having windows), but reading a bit on it
suggests that there could be memory leaks on Windows if QPalette's are
not properly managed/deleted.
It also suggests the attached. I really do not fully understand this
(and the most elaborate information I got was AI generated), but it
might be worth testing whether this helps.
Another possibility is that the leak happens in refillToolbars().
In any case, Baris, you could check whether the hypothesis
(QEvent::ThemeChange being the cause) is true by setting Tools >
Preferences > User Interface > Color Scheme from "System Default" to
either "Dark Mode" or "Light Mode". This will cause the dignal to be
ignored.
--
Jürgen
diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index f64c368a59..06b4bd3c6b 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -1906,7 +1906,8 @@ bool GuiView::event(QEvent * e)
#if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0)
case QEvent::ThemeChange: {
if (lyxrc.color_scheme != "dark" && lyxrc.color_scheme != "light") {
- guiApp->setPalette(guiApp->style()->standardPalette());
+ QPalette newPalette = guiApp->style()->standardPalette();
+ guiApp->setPalette(newPalette);
// We need to update metrics here to avoid a crash (#12786)
theBufferList().changed(true);
refillToolbars();
--
lyx-devel mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-devel