From de58c9a3ae27efe1e3763c9e4a0b3fa0ed15ef0e Mon Sep 17 00:00:00 2001 From: Joe Carroll Date: Fri, 9 Oct 2015 10:11:18 -0500 Subject: [PATCH] fix SA xcode 7 pointed out --- Reachability.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Reachability.m b/Reachability.m index 4c1c94a..d95f361 100644 --- a/Reachability.m +++ b/Reachability.m @@ -100,6 +100,8 @@ +(instancetype)reachabilityWithHostname:(NSString*)hostname { id reachability = [[self alloc] initWithReachabilityRef:ref]; + CFRelease(ref); + return reachability; } @@ -112,7 +114,9 @@ +(instancetype)reachabilityWithAddress:(void *)hostAddress if (ref) { id reachability = [[self alloc] initWithReachabilityRef:ref]; - + + CFRelease(ref); + return reachability; } @@ -152,6 +156,8 @@ -(instancetype)initWithReachabilityRef:(SCNetworkReachabilityRef)ref self.reachableOnWWAN = YES; self.reachabilityRef = ref; + CFRetain(self.reachabilityRef); + // We need to create a serial queue. // We allocate this once for the lifetime of the notifier.