Potential leak of an object stor
2019-03-29 本文已影响0人
提灯走夜路
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, hostAddress);
Reachability* returnValue =NULL;
if(reachability !=NULL)
{
returnValue = [[selfalloc]init];
if(returnValue !=NULL)
{
returnValue->_reachabilityRef= reachability;
}
else{
CFRelease(reachability);
}
}
returnreturnValue;
https://developer.apple.com/library/archive/samplecode/Reachability/Introduction/Intro.html