diff --git a/.changes/local-track-crash b/.changes/local-track-crash new file mode 100644 index 000000000..a50b68eee --- /dev/null +++ b/.changes/local-track-crash @@ -0,0 +1 @@ +patch type="fixed" "Crash in LocalAudioTrack.deinit" \ No newline at end of file diff --git a/Sources/LiveKit/Track/Local/LocalAudioTrack.swift b/Sources/LiveKit/Track/Local/LocalAudioTrack.swift index 3344f2a67..a9f3d3e6b 100644 --- a/Sources/LiveKit/Track/Local/LocalAudioTrack.swift +++ b/Sources/LiveKit/Track/Local/LocalAudioTrack.swift @@ -49,7 +49,9 @@ public class LocalAudioTrack: Track, LocalTrackProtocol, AudioTrackProtocol, @un } deinit { - cleanUpFrameWatcher() + if let watcher = _frameWatcherState.frameWatcher { + remove(audioRenderer: watcher) + } } public static func createTrack(name: String = Track.microphoneName,