Merge pull request #4520 from nextcloud/bugfix/findersync-crash-fix

Fix crashing of finder sync extension caused by dispatch_source_cancel of nullptr
This commit is contained in:
Claudio Cambra 2022-05-16 13:15:33 +02:00 committed by GitHub
commit e84c6ef663
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -137,10 +137,17 @@
- (void)closeConnection - (void)closeConnection
{ {
NSLog(@"Closing connection."); NSLog(@"Closing connection.");
if(self.readSource) {
dispatch_source_cancel(self.readSource); dispatch_source_cancel(self.readSource);
dispatch_source_cancel(self.writeSource);
self.readSource = nil; self.readSource = nil;
}
if(self.writeSource) {
dispatch_source_cancel(self.writeSource);
self.writeSource = nil; self.writeSource = nil;
}
[self.inBuffer setLength:0]; [self.inBuffer setLength:0];
[self.outBuffer setLength: 0]; [self.outBuffer setLength: 0];