Repository: cordova-plugin-file-transfer Updated Branches: refs/heads/master 97031b2d7 -> 9e93bad83
CB-8863 fix block usage of self Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/commit/9e93bad8 Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/tree/9e93bad8 Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/diff/9e93bad8 Branch: refs/heads/master Commit: 9e93bad83c9e980cb593dc057fe8af40f35652f1 Parents: 97031b2 Author: Jesse MacFadyen <purplecabb...@gmail.com> Authored: Thu Nov 19 17:02:35 2015 -0800 Committer: Jesse MacFadyen <purplecabb...@gmail.com> Committed: Thu Nov 19 17:02:35 2015 -0800 ---------------------------------------------------------------------- src/ios/CDVFileTransfer.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-file-transfer/blob/9e93bad8/src/ios/CDVFileTransfer.m ---------------------------------------------------------------------- diff --git a/src/ios/CDVFileTransfer.m b/src/ios/CDVFileTransfer.m index dca440a..ee32b92 100644 --- a/src/ios/CDVFileTransfer.m +++ b/src/ios/CDVFileTransfer.m @@ -305,13 +305,14 @@ static CFIndex WriteDataToStream(NSData* data, CFWriteStreamRef stream) fs = [[self.commandDelegate getCommandInstance:@"File"] filesystemForURL:sourceURL]; } if (fs) { + __weak CDVFileTransfer* weakSelf = self; [fs readFileAtURL:sourceURL start:0 end:-1 callback:^(NSData *fileData, NSString *mimeType, CDVFileError err) { if (err) { // We couldn't find the asset. Send the appropriate error. - CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[self createFileTransferError:NOT_FOUND_ERR AndSource:source AndTarget:server]]; - [self.commandDelegate sendPluginResult:result callbackId:command.callbackId]; + CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsDictionary:[weakSelf createFileTransferError:NOT_FOUND_ERR AndSource:source AndTarget:server]]; + [weakSelf.commandDelegate sendPluginResult:result callbackId:command.callbackId]; } else { - [self uploadData:fileData command:command]; + [weakSelf uploadData:fileData command:command]; } }]; return; --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org