个播房背景显示优化,退房后停掉关注主播定时器

This commit is contained in:
chenguilong
2022-03-10 15:37:56 +08:00
parent 1923978f38
commit 244ed6b24d
2 changed files with 14 additions and 7 deletions

View File

@@ -46,6 +46,13 @@
@end
@implementation XPRoomFunctionContainerView
- (void)dealloc {
if (self.followAnchorTimer != nil) {
dispatch_source_cancel(self.followAnchorTimer);
}
}
- (instancetype)initWithdelegate:(id<RoomHostDelegate>)delegate {
self = [super init];
if (self) {
@@ -229,7 +236,10 @@
dispatch_source_set_event_handler(self.followAnchorTimer, ^{
dispatch_async(dispatch_get_main_queue(), ^{
@strongify(self);
dispatch_source_cancel(self.followAnchorTimer);
if (self.followAnchorTimer != nil) {
dispatch_source_cancel(self.followAnchorTimer);
self.followAnchorTimer = nil;
}
RoomInfoModel* roomInfo = self.delegate.getRoomInfo;
NSString *roomUid = [NSString stringWithFormat:@"%zd", roomInfo.uid];
NSString * uid = [[AccountInfoStorage instance] getUid];