mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
bb57e0498c
The SessionManager's background cleanup goroutine previously had no shutdown mechanism. Each call to NewSessionManager() started a ticker goroutine that ran indefinitely. In tests, where multiple SessionManagers are created, this caused goroutine leaks. This commit adds a Stop() method that cleanly shuts down the background cleanup goroutine via a channel. Stop() is safe to call multiple times. All existing tests now call t.Cleanup(sm.Stop) to ensure cleanup.