Skip to content

Commit

Permalink
using NSMutableArray sortUsingFunction instead of NSArray sortedArray…
Browse files Browse the repository at this point in the history
…UsingFunction

性能优化,同时也会修正多线程下使用LFStreamSocket推流的内存泄漏问题
  • Loading branch information
linyehui committed Dec 6, 2016
1 parent f6feec3 commit 0510aaf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions LFLiveKit/publish/LFStreamingBuffer.m
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ - (void)appendObject:(LFFrame *)frame {
} else {
///< 排序
[self.sortList addObject:frame];
NSArray *sortedSendQuery = [self.sortList sortedArrayUsingFunction:frameDataCompare context:NULL];
[self.sortList removeAllObjects];
[self.sortList addObjectsFromArray:sortedSendQuery];
[self.sortList sortUsingFunction:frameDataCompare context:nil];
/// 丢帧
[self removeExpireFrame];
/// 添加至缓冲区
Expand Down

0 comments on commit 0510aaf

Please sign in to comment.