Drawing PDF page using CGContextDrawPDFPage Leak Abnormally?

Don't use CGPDFDocumentRef pdf = CGPDFDocumentCreateWithURL(pdfURL) in drawLayer Since every time this is called it creates a new document ref. Instead create a single document ref in your view controller and use it everytime Use this line instead CGPDFPageRelease (page).

Don't use CGPDFDocumentRef pdf = CGPDFDocumentCreateWithURL(pdfURL); in drawLayer. Since every time this is called it creates a new document ref. Instead create a single document ref in your view controller and use it everytime.

Use this line instead CGPDFPageRelease (page).

CGPDFDocumentRef should be created once.. It takes lots of memory – Dimple Panchal Nov 16 at 11:22 put the CGPDFDocumentRef in view controller, and then passing to the view and rendering. But CGContextDrawPDFPage(ctx, page); keep showing leak in instrument and memory is increase overtime. And in this link stackoverflow.

Com/questions/3889634/…, I was told to release and reinit every time to draw layer? – Lunayo Nov 16 at 11:25 I checked it now.. With Instrument.. My code is not leaking. You need to release page instead of Document – Dimple Panchal Nov 16 at 11:31 I render page each time I swipe the page.

Page is get from cgpdfdocument is that necessary to release? Have you tried calling the draw layer in looping? – Lunayo Nov 16 at 11:35.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions