mirror of
https://gitee.com/shuto-github/cordova-plugin-network-information.git
synced 2026-05-10 00:00:02 +08:00
CB-11838 ios: Unregister callback function at the right timing.
We at LINE observed about 40K crashes a day that were suspected to be caused by the reacahability callback function invoked on an already-deallocated object. We couldn't reproduced the crash locally but this patch did reduce the number of crash reports to zero. This closes #49
This commit is contained in:
committed by
Julio César
parent
ee0cb16e58
commit
f4f1abec3a
@@ -120,6 +120,7 @@ static void CDVReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRe
|
||||
- (void)stopNotifier
|
||||
{
|
||||
if (reachabilityRef != NULL) {
|
||||
SCNetworkReachabilitySetCallback(reachabilityRef, NULL, NULL);
|
||||
SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user