Skip to content

Commit

Permalink
Fix Core CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF warnings (firebase#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 committed Feb 9, 2018
1 parent bf45a15 commit 612d99c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions Firebase/Core/FIRMutableDictionary.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,41 +37,41 @@ - (instancetype)init {
- (NSString *)description {
__block NSString *description;
dispatch_sync(_queue, ^{
description = _objects.description;
description = self->_objects.description;
});
return description;
}

- (id)objectForKey:(id)key {
__block id object;
dispatch_sync(_queue, ^{
object = _objects[key];
object = self->_objects[key];
});
return object;
}

- (void)setObject:(id)object forKey:(id<NSCopying>)key {
dispatch_async(_queue, ^{
_objects[key] = object;
self->_objects[key] = object;
});
}

- (void)removeObjectForKey:(id)key {
dispatch_async(_queue, ^{
[_objects removeObjectForKey:key];
[self->_objects removeObjectForKey:key];
});
}

- (void)removeAllObjects {
dispatch_async(_queue, ^{
[_objects removeAllObjects];
[self->_objects removeAllObjects];
});
}

- (NSUInteger)count {
__block NSUInteger count;
dispatch_sync(_queue, ^{
count = _objects.count;
count = self->_objects.count;
});
return count;
}
Expand All @@ -89,7 +89,7 @@ - (void)setObject:(id)obj forKeyedSubscript:(id<NSCopying>)key {
- (NSDictionary *)dictionary {
__block NSDictionary *dictionary;
dispatch_sync(_queue, ^{
dictionary = [_objects copy];
dictionary = [self->_objects copy];
});
return dictionary;
}
Expand Down
14 changes: 7 additions & 7 deletions Firebase/Core/FIRNetworkURLSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,11 @@ - (void)URLSession:(NSURLSession *)session
if (allow) {
completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
} else {
[_loggerDelegate
[self->_loggerDelegate
firNetwork_logWithLevel:kFIRNetworkLogLevelDebug
messageCode:kFIRNetworkMessageCodeURLSession007
message:@"Cancelling authentication challenge for host. Host"
context:_request.URL];
context:self->_request.URL];
completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
}
};
Expand All @@ -344,10 +344,10 @@ - (void)URLSession:(NSURLSession *)session
}

if (trustError != errSecSuccess) {
[_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelError
messageCode:kFIRNetworkMessageCodeURLSession008
message:@"Cannot evaluate server trust. Error, host"
contexts:@[ @(trustError), _request.URL ]];
[self->_loggerDelegate firNetwork_logWithLevel:kFIRNetworkLogLevelError
messageCode:kFIRNetworkMessageCodeURLSession008
message:@"Cannot evaluate server trust. Error, host"
contexts:@[ @(trustError), self->_request.URL ]];
shouldAllow = NO;
} else {
// Having a trust level "unspecified" by the user is the usual result, described at
Expand Down Expand Up @@ -651,7 +651,7 @@ - (void)callCompletionHandler:(FIRNetworkURLSessionCompletionHandler)handler

if (handler) {
dispatch_async(dispatch_get_main_queue(), ^{
handler(response, data, _sessionID, error);
handler(response, data, self->_sessionID, error);
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion Firebase/Core/FIROptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ - (NSDictionary *)analyticsOptionsDictionaryWithInfoDictionary:(NSDictionary *)i
}
tempAnalyticsOptions[key] = value;
}
_analyticsOptionsDictionary = tempAnalyticsOptions;
self->_analyticsOptionsDictionary = tempAnalyticsOptions;
});
return _analyticsOptionsDictionary;
}
Expand Down

0 comments on commit 612d99c

Please sign in to comment.