From ab39552cdb0c004824edb625979db0e034f73f4e Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Thu, 24 Sep 2026 18:58:42 -0400 Subject: [PATCH] refactor(display): stop the frame-timing watchdog at the end of cleanup() #628 adds its snapshot-writer stop at the top of cleanup(); with this at the top as well, merging #629 after #628 conflicted. Same behaviour, no overlap. Co-Authored-By: Claude Opus 5.5 --- src/display_manager.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/display_manager.py b/src/display_manager.py index 529e1f6c..763bea95 100644 --- a/src/display_manager.py +++ b/src/display_manager.py @@ -1282,8 +1282,6 @@ class DisplayManager: def cleanup(self): """Clean up resources.""" - if getattr(self, 'frame_timing', None) is not None: - self.frame_timing.close() if hasattr(self, 'matrix') and self.matrix is not None: try: self.matrix.Clear() @@ -1295,6 +1293,9 @@ class DisplayManager: self._new_canvas(self.width, self.height) except (OSError, RuntimeError, ValueError, MemoryError): logger.debug("Canvas reset during cleanup failed", exc_info=True) + # The stall watchdog would otherwise outlive this manager. + if getattr(self, 'frame_timing', None) is not None: + self.frame_timing.close() # Reset the singleton state when cleaning up DisplayManager._instance = None