mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-03 13:13:55 +00:00
make reloadData thread safe
This commit is contained in:
parent
daedf73f20
commit
77113c6698
@ -135,7 +135,13 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
{
|
||||
[_dataController reloadData];
|
||||
|
||||
[super reloadData];
|
||||
if ([NSThread isMainThread]) {
|
||||
[super reloadData];
|
||||
} else {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[super reloadData];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setDataSource:(id<UICollectionViewDataSource>)dataSource
|
||||
|
||||
@ -186,7 +186,13 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
{
|
||||
[_dataController reloadData];
|
||||
|
||||
[super reloadData];
|
||||
if ([NSThread isMainThread]) {
|
||||
[super reloadData];
|
||||
} else {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[super reloadData];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (ASRangeTuningParameters)rangeTuningParameters
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user