fix crash on track delete

This commit is contained in:
Ruben van de Ven 2024-11-05 15:52:02 +01:00
parent c3263e7448
commit 3d8cb7ef70

View file

@ -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')