[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:
Riley Testut
2022-05-25 14:59:12 -07:00
parent 26ef3073ae
commit fd81092392

View File

@@ -144,5 +144,10 @@ private extension WirelessConnectionHandler
connection.disconnect()
self.disconnectionHandler?(connection)
if let networkConnection = connection as? NetworkConnection
{
networkConnection.nwConnection.stateUpdateHandler = nil
}
}
}