I want to render PDFs on iOS and I'm getting a memory leak when I call CGPDFDocumentCreateWithURL(). I know this issue has been discussed before, but I don't know whether my conditions are different because I'm using ARC.
I've extracted and simplified the problem by running the following code on my viewDidLoad:
// Bridge resourceRef to ARC with no ownership change (still owned by ARC)
CFURLRef resourceRef = (__bridge CFURLRef) [NSURL fileURLWithPath:htmlPath];
CGPDFDocumentRef pdf;
pdf = CGPDFDocumentCreateWithURL(resourceRef);
CGPDFDocumentRelease(pdf);
// Do not need to release resourceRef because ARC will release it
Instruments tells me that the Leaked Object is a Malloc 48 Bytes, responsible by CoreGraphics. And the stacktrace has CGPDFDocumentCreateWithURL in it. Leaking means that there is object out there without an owner.
I've create a git repo with a replication of the problem: https://github.com/indika/PDFLeaks
Any ideas. Would appreciate any help or 'pointers'.