Skip to content

Commit

Permalink
Remove NSDataReadingMappedIfSafe when reading attachment content
Browse files Browse the repository at this point in the history
NSDataReadingMappedIfSafe option can keep the file descriptors of the attachments open if the client application keeps holding the NSData object returned by CBLAttachment.content.

For a very big attachment, alternatively, users can call contentURL and read the NSData with the NSDataReadingMappedIfSafe option themselves.

#649
  • Loading branch information
pasin committed Apr 13, 2015
1 parent bbd3b72 commit d7f0855
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/API/CBLAttachment.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ - (NSData*) content {
return _body;
else if ([_body isKindOfClass: [NSURL class]] && [_body isFileURL]) {
return [NSData dataWithContentsOfURL: _body
options: NSDataReadingMappedIfSafe | NSDataReadingUncached
options: NSDataReadingUncached
error: nil];
}
return nil;
Expand Down

0 comments on commit d7f0855

Please sign in to comment.