Skip to content

Conversation

@hiroshihorie
Copy link
Member

No description provided.

@github-actions
Copy link

github-actions bot commented Sep 15, 2025

⚠️ This PR does not contain any files in the .changes directory.

set {
capturePostProcessingDelegateAdapter.set(target: newValue)
capturePostProcessingDelegateSubject.send(newValue)
public weak var capturePostProcessingDelegate: AudioCustomProcessingDelegate? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need to set it weak ? or we make sure it will be set to nil when AudioRenderer get removed from the track ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally agree with this comment as posted elsewhere, for delegates it's the "default" approach, but for "top-down" ownership model (no cycles) we should use weak sparingly.

Copy link
Member Author

@hiroshihorie hiroshihorie Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either option works for me, as long as we’re okay with having inconsistencies related to the delegate weakness in the SDK, since anything using MulticastDelegate is weak now, e.g. room.add(delegate:), AudioManager.shared.add(localAudioRenderer:), etc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately I don't see any option to "automate" it e.g. via swiftlint as every use case is vastly different and must be evaluated separately 😿

Copy link
Contributor

@xianshijing-lk xianshijing-lk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one nit, I am OK with the change if you think weak is better

@hiroshihorie hiroshihorie marked this pull request as ready for review October 7, 2025 09:40
@hiroshihorie hiroshihorie merged commit 14a0092 into main Oct 7, 2025
2 of 3 checks passed
@hiroshihorie hiroshihorie deleted the hiroshi/audio-processing-lifecycle branch October 7, 2025 12:22
@hiroshihorie
Copy link
Member Author

Hmm... looks like something broke with this PR 😢

hiroshihorie added a commit that referenced this pull request Oct 18, 2025
#784 Broke `LocalAudioTrack.add(audioRenderer: AudioRenderer)` so this
PR fixes it...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants