diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-20 07:06:04 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-20 07:06:04 +0300 |
| commit | 7c8e71b85d6475576bc1d22472ee399de7b62247 (patch) | |
| tree | d3b79582b039c996bb0f736ae229eec96ee4263a /player-android/android/app/src | |
| parent | d2c18b25caffafa64d90195d24bca77315f76d16 (diff) | |
Make GCWorker.Start idempotent via sync.Once (x9)
Calling Start a second time used to spawn a duplicate goroutine,
leaking the first one and double-counting tick events. sync.Once
matches the existing lifecycle (Stop is also one-shot — the worker
is not designed to be restarted after Stop), so the simplest fix is
a startOnce.Do guard. Added a unit test that calls Start twice and
asserts only one goroutine runs.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Diffstat (limited to 'player-android/android/app/src')
0 files changed, 0 insertions, 0 deletions
