Cleanup statsGetter after peer is closed

This commit is contained in:
Joe Turki
2025-09-19 05:42:41 +03:00
parent 4c1261ff83
commit 9acbc661f6
3 changed files with 31 additions and 0 deletions

View File

@@ -69,6 +69,11 @@ func lookupStats(id string) (stats.Getter, bool) {
return nil, false
}
// cleanupStats removes the stats getter for a given peerconnection.statsId.
func cleanupStats(id string) {
statsGetter.Delete(id)
}
// key: string (peerconnection.statsId), value: stats.Getter
var statsGetter sync.Map // nolint:gochecknoglobals