From d7f0855471164b21db68677cceb7c432b969f80b Mon Sep 17 00:00:00 2001 From: Pasin Suriyentrakorn Date: Mon, 13 Apr 2015 11:47:17 -0700 Subject: [PATCH] Remove NSDataReadingMappedIfSafe when reading attachment content 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 --- Source/API/CBLAttachment.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/API/CBLAttachment.m b/Source/API/CBLAttachment.m index 0fd1a8594..dee2dfb88 100644 --- a/Source/API/CBLAttachment.m +++ b/Source/API/CBLAttachment.m @@ -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;