Explicitly retain self in objc blocks to avoid compiler warning.

Implicitly retaining self pointer (assuming this is intended behavior) causes compiler warning `-Wimplicit-retain-self`. We should do it explicitly.

Bug: webrtc:9971
Change-Id: If77a67168d8a65ced78d5119b9a7332391d20bc9
Reviewed-on: https://webrtc-review.googlesource.com/c/109641
Commit-Queue: Jiawei Ou <ouj@fb.com>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25609}
This commit is contained in:
Jiawei Ou
2018-11-09 13:55:45 -08:00
committed by Commit Bot
parent 0c32e33b48
commit 4aeb35b6d0
10 changed files with 248 additions and 208 deletions

View File

@ -39,6 +39,7 @@ static NSUInteger const kBottomViewHeight = 200;
@property(nonatomic, weak) id<APPRTCMainViewDelegate> delegate;
@property(nonatomic, readonly) NSView<RTCVideoRenderer>* localVideoView;
@property(nonatomic, readonly) NSView<RTCVideoRenderer>* remoteVideoView;
@property(nonatomic, readonly) NSTextView* logView;
- (void)displayLogMessage:(NSString*)message;
@ -52,7 +53,6 @@ static NSUInteger const kBottomViewHeight = 200;
NSButton* _connectButton;
NSButton* _loopbackButton;
NSTextField* _roomField;
NSTextView* _logView;
CGSize _localVideoSize;
CGSize _remoteVideoSize;
}
@ -60,14 +60,13 @@ static NSUInteger const kBottomViewHeight = 200;
@synthesize delegate = _delegate;
@synthesize localVideoView = _localVideoView;
@synthesize remoteVideoView = _remoteVideoView;
@synthesize logView = _logView;
- (void)displayLogMessage:(NSString *)message {
dispatch_async(dispatch_get_main_queue(), ^{
_logView.string =
[NSString stringWithFormat:@"%@%@\n", _logView.string, message];
NSRange range = NSMakeRange(_logView.string.length, 0);
[_logView scrollRangeToVisible:range];
self.logView.string = [NSString stringWithFormat:@"%@%@\n", self.logView.string, message];
NSRange range = NSMakeRange(self.logView.string.length, 0);
[self.logView scrollRangeToVisible:range];
});
}