From 08338746e2df6fcf3b03038b841d5968fe91bd6f Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Wed, 18 Mar 2026 22:59:24 +0100 Subject: [PATCH] Deactivate graph poll timer on client disconnect Prevents 'parent slot deleted' RuntimeError when the timeline tab is destroyed while the timer is still firing. Co-Authored-By: Claude Opus 4.6 --- tab_timeline_ng.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tab_timeline_ng.py b/tab_timeline_ng.py index e39a607..5e2802d 100644 --- a/tab_timeline_ng.py +++ b/tab_timeline_ng.py @@ -467,6 +467,11 @@ def render_timeline_tab(state: AppState): graph_timer = ui.timer(0.5, _poll_graph_click) + def _cleanup_timer(): + if graph_timer is not None: + graph_timer.active = False + ui.context.client.on_disconnect(_cleanup_timer) + _graphviz_svg_cache: dict[str, str] = {} _GRAPHVIZ_CACHE_MAX = 20