Closed UnsafePointer closed 11 years ago
Hi Renzo. Can you drill down in Instruments to find out exactly what object is leaking, and the line of code it is happening on?
I notice you have the call to imageWithPDFNamed:
inside a loop. In my experience, loops and auto-released objects do not mix well. Have you tried draining the auto release pool? This link could help: http://stackoverflow.com/questions/65427/how-does-the-nsautoreleasepool-autorelease-pool-work
Best, Nigel.
Hi Renzo. Did you manage to find to the leak?
Best, Nigel.
Hi Nigel, I try draining the auto release pool manually without success. The leak is still there.
Hi Renzo. Is your project using ARC? UIImage+PDF has not been adapted for ARC yet.
Best, Nigel.
No, I'm using old school memory management. But I end in the conclusion that UIImage+PDF is no the reason. Inverted Call Tree + Show Obj-C Only on Leaks Instruments show that the leak occurs on [PDFView drawRect:] only when opening full colour pdf files, opening documents or so doesn't leak.
Can you send me a stripped-down project so that I can try to recreate the problem here?
Hi. I've now updated the project to use ARC. I hope this helps with your memory issues.
First, great UIImage extension category, I'm loving it so far. I'm having a hard time trying to clean this huge leak on PDFView drawRect.
I'm using UIImage+PDF to make a gallery thumbnail with the pdf first page with this code:
And I'm getting the leaks on PDFView drawRect, any idea that might be happening?
Thanks in advance,
Renzo Crisóstomo.