Skip to content

Commit

Permalink
Merge pull request #1442 from shogo4405/feature/fix-memory-leak-audio…
Browse files Browse the repository at this point in the history
…-mixer

fixed memory leak IOAudioMixer classes.
  • Loading branch information
shogo4405 authored May 12, 2024
2 parents 299562f + f221777 commit c08eb35
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Examples/iOS/AudioCapture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ protocol AudioCaptureDelegate: AnyObject {

final class AudioCapture {
var isRunning: Atomic<Bool> = .init(false)
var delegate: (any AudioCaptureDelegate)?
weak var delegate: (any AudioCaptureDelegate)?
private let audioEngine = AVAudioEngine()
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/IO/IOAudioMixerByMultiTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Foundation
final class IOAudioMixerByMultiTrack: IOAudioMixerConvertible {
private static let defaultSampleTime: AVAudioFramePosition = 0

var delegate: (any IOAudioMixerDelegate)?
weak var delegate: (any IOAudioMixerDelegate)?
var settings = IOAudioMixerSettings.default {
didSet {
if let inSourceFormat, settings.invalidateOutputFormat(oldValue) {
Expand Down
2 changes: 1 addition & 1 deletion Sources/IO/IOAudioMixerBySingleTrack.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import AVFoundation
import Foundation

final class IOAudioMixerBySingleTrack: IOAudioMixerConvertible {
var delegate: (any IOAudioMixerDelegate)?
weak var delegate: (any IOAudioMixerDelegate)?
var settings = IOAudioMixerSettings.default {
didSet {
if let trackSettings = settings.tracks[settings.mainTrack] {
Expand Down
2 changes: 1 addition & 1 deletion Sources/IO/IOTellyUnit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class IOTellyUnit {
return mediaLink.playerNode
}

var delegate: (any IOTellyUnitDelegate)?
weak var delegate: (any IOTellyUnitDelegate)?

private lazy var mediaLink = {
var mediaLink = MediaLink<IOTellyUnit>()
Expand Down

0 comments on commit c08eb35

Please sign in to comment.