Skip to content

Commit

Permalink
Fix lifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
ipavlidakis committed Feb 4, 2025
1 parent d313e61 commit 383e60a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ final class StreamAudioSessionAdapter: NSObject, RTCAudioSessionDelegate, @unche
}
}

deinit {
func dismantle() {
if StreamActiveCallAudioSessionKey.currentValue === self {
// Reset activeCall audioSession.
StreamActiveCallAudioSessionKey.currentValue = nil
Expand Down
4 changes: 4 additions & 0 deletions Sources/StreamVideo/WebRTC/v2/WebRTCStateAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ actor WebRTCStateAdapter: ObservableObject, StreamAudioSessionAdapterDelegate {
audioSession.delegate = self
}

deinit {
audioSession.dismantle()
}

/// Sets the session ID.
func set(sessionID value: String) {
self.sessionID = value
Expand Down

0 comments on commit 383e60a

Please sign in to comment.