1
我有與無功的泄漏,我不知道如何解決它...SCNetworkReachabilityRef泄漏上的Xcode
下面的代碼:
bool success = false;
const char *host_name = [@"www.google.com" cStringUsingEncoding:NSASCIIStringEncoding];
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, host_name);
SCNetworkReachabilityFlags flags;
success = SCNetworkReachabilityGetFlags(reachability, &flags);
bool isAvailable = success && (flags & kSCNetworkFlagsReachable) &&
!(flags & kSCNetworkFlagsConnectionRequired);
if (isAvailable) {
...
}else{
...
}
CFRelease(reachability);
泄漏:爲 90.5%線
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, host_name);
和該行9.5%:
success = SCNetworkReachabilityGetFlags(reachability, &flags);
就是這樣。所以,如果你能幫助我,這可能是非常好的:D謝謝