mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
[AltServer] Fixes NetworkConnection strong reference cycle
WirelessConnection.nwConnection.stateUpdateHandler maintains strong reference to WirelessConnection, resulting in strong reference cycle. To break it, we now explicitly set stateUpdateHandler to nil when disconnecting.
This commit is contained in:
@@ -144,5 +144,10 @@ private extension WirelessConnectionHandler
|
||||
connection.disconnect()
|
||||
|
||||
self.disconnectionHandler?(connection)
|
||||
|
||||
if let networkConnection = connection as? NetworkConnection
|
||||
{
|
||||
networkConnection.nwConnection.stateUpdateHandler = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user