mirror of
https://gitee.com/shuto/cordova-plugin-network-information.git
synced 2025-01-31 10:35:43 +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:
parent
ee0cb16e58
commit
f4f1abec3a
@ -120,6 +120,7 @@ static void CDVReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRe
|
|||||||
- (void)stopNotifier
|
- (void)stopNotifier
|
||||||
{
|
{
|
||||||
if (reachabilityRef != NULL) {
|
if (reachabilityRef != NULL) {
|
||||||
|
SCNetworkReachabilitySetCallback(reachabilityRef, NULL, NULL);
|
||||||
SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
|
SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user