Commit 7f6c27cf authored by Tobias's avatar Tobias

fix crash: delegate callback which triggered layout in background thread

parent fb5d89b5
......@@ -53,8 +53,14 @@ NSString *const VLCSharedLibraryParserDeterminedNetserviceAsVLCInstance = @"VLCS
{
NSArray *parsedContents = [self downloadAndProcessDataFromServer:hostnameAndPort];
if ([self.delegate respondsToSelector:@selector(sharedLibraryDataProcessings:)])
[self.delegate sharedLibraryDataProcessings:parsedContents];
__weak typeof(self) weakSelf = self;
[[NSOperationQueue mainQueue] addOperationWithBlock:^{
id delegate = weakSelf.delegate;
if ([delegate respondsToSelector:@selector(sharedLibraryDataProcessings:)]) {
[delegate sharedLibraryDataProcessings:parsedContents];
}
}];
}
- (NSArray *)downloadAndProcessDataFromServer:(NSString *)hostnamePort
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment