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 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-09-24 18:58:42 -04:00
co-authored by Claude Opus 5.5
parent 37203e635c
commit ab39552cdb
+3 -2
View File
@@ -1282,8 +1282,6 @@ class DisplayManager:
def cleanup(self): def cleanup(self):
"""Clean up resources.""" """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: if hasattr(self, 'matrix') and self.matrix is not None:
try: try:
self.matrix.Clear() self.matrix.Clear()
@@ -1295,6 +1293,9 @@ class DisplayManager:
self._new_canvas(self.width, self.height) self._new_canvas(self.width, self.height)
except (OSError, RuntimeError, ValueError, MemoryError): except (OSError, RuntimeError, ValueError, MemoryError):
logger.debug("Canvas reset during cleanup failed", exc_info=True) 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 # Reset the singleton state when cleaning up
DisplayManager._instance = None DisplayManager._instance = None