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:
Ken'ichi Fukushima 2016-09-12 18:28:49 +09:00 committed by Julio César
parent ee0cb16e58
commit f4f1abec3a

View File

@ -120,6 +120,7 @@ static void CDVReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRe
- (void)stopNotifier
{
if (reachabilityRef != NULL) {
SCNetworkReachabilitySetCallback(reachabilityRef, NULL, NULL);
SCNetworkReachabilityUnscheduleFromRunLoop(reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
}
}