Skip to content

Conversation

@thomasameisel
Copy link
Contributor

Add weak_ptr to NetworkInformation in SetupNetDetect

@thomasameisel thomasameisel requested a review from a team as a code owner January 5, 2026 23:51
@ThomsonTan
Copy link
Contributor

Is this required to be included in the release?

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a weak pointer to NetworkInformation in the SetupNetDetect method to prevent potential retain cycles when capturing this in Objective-C blocks. This is a defensive programming practice that ensures the NetworkInformation object can be properly deallocated even if the callback outlives the object.

Key Changes:

  • Added weak_ptr initialization from shared_from_this() before setting up the network path monitor callback

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@thomasameisel
Copy link
Contributor Author

Is this required to be included in the release?

Yes, because the weak_this variable is referenced below.

@lalitb lalitb merged commit a1b38a7 into main Jan 6, 2026
23 of 33 checks passed
@lalitb lalitb deleted the thmeisel/Fix-NetworkInformationImpl branch January 6, 2026 01:07
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