From 3d8cb7ef70fbf851ef2cad577ffea54e4fcaace7 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Tue, 5 Nov 2024 15:52:02 +0100 Subject: [PATCH] fix crash on track delete --- trap/renderer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/trap/renderer.py b/trap/renderer.py index ce3348e..3e3593e 100644 --- a/trap/renderer.py +++ b/trap/renderer.py @@ -462,10 +462,12 @@ class Renderer: self.drawn_tracks[track_id].set_track(track, self.prediction_frame.H) # clean up - for track in self.drawn_tracks.values(): - if track.update_at < time.time() - 5: + for track_id in list(self.drawn_tracks.keys()): + # TODO make delay configurable + if self.drawn_tracks[track_id].update_at < time.time() - 5: # TODO fade out del self.drawn_tracks[track_id] + def on_key_press(self, symbol, modifiers): print('A key was pressed, use f to hide')