From 27b98ffe1e0c45307d6df3fdfa0f664e6ec41a1f Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sun, 8 Mar 2026 21:20:13 -0400 Subject: [PATCH] fix(ui): Prevent PopStyleColor crash by using frame-scoped tint flag --- src/gui_2.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui_2.py b/src/gui_2.py index db2c69f..4d9f6c1 100644 --- a/src/gui_2.py +++ b/src/gui_2.py @@ -256,9 +256,11 @@ class App: imgui.end_menu() def _gui_func(self) -> None: + pushed_prior_tint = False if self.perf_profiling_enabled: self.perf_monitor.start_component("_gui_func") if self.is_viewing_prior_session: imgui.push_style_color(imgui.Col_.window_bg, vec4(50, 40, 20)) + pushed_prior_tint = True try: self.perf_monitor.start_frame() self._autofocus_response_tab = self.controller._autofocus_response_tab @@ -761,7 +763,7 @@ class App: import traceback traceback.print_exc() - if self.is_viewing_prior_session: + if pushed_prior_tint: imgui.pop_style_color() if self.perf_profiling_enabled: self.perf_monitor.end_component("_gui_func")