Memory leakage with following code
Here is the code where I am having memory leaks:
SCNetworkReachabilityRef reach = SCNetworkReachabilityCreateWithName(kCFAllocatorSy stemDefault, "google.com");
SCNetworkConnectionFlags flags;
SCNetworkReachabilityGetFlags(reach, &flags);
[flags re开发者_StackOverflowlease];
[reach release];
Those release don't do it.
First of all, the SCNetworkConnectionFlags
is an enum
, so it doesn't have to be released. Remove the [flags release]
and problem solved.
Moving on, the SCNetworkReachabilityRef
is released through
CFRelease(reach);
精彩评论