Detach tone-test savers on reconnect

This commit is contained in:
Brandon McGinty (chatgpt)
2026-08-09 23:12:56 -04:00
committed by Brandon McGinty
parent b23afebdb3
commit bad4e8172a
4 changed files with 66 additions and 15 deletions
+2 -5
View File
@@ -68,7 +68,7 @@ func (b *Barnard) connect(reconnect bool) bool {
return false
}
b.toneTestSaver = saver
b.Client.Config.AttachAudio(saver)
b.toneTestSaverDetach = b.Client.Config.AttachAudio(saver)
b.Connected = true
if b.toneTestAutoTransmit() {
@@ -191,10 +191,7 @@ func (b *Barnard) OnDisconnect(e *gumble.DisconnectEvent) {
close(b.toneTestStop)
b.toneTestStop = nil
}
if b.toneTestSaver != nil {
b.toneTestSaver.Stop()
b.toneTestSaver = nil
}
b.cleanupToneTestAudio()
}
b.Notify("disconnect", "me", reason)