• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSPDFImageRep Memory Leak?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSPDFImageRep Memory Leak?


  • Subject: NSPDFImageRep Memory Leak?
  • From: DairyKnight <email@hidden>
  • Date: Tue, 8 Sep 2009 20:08:16 +0800

Hi all,

I'm trying to rasterize a PDF document using PDFKit, but it seems NSPDFImageRep
has a terrible memory leak, which
crashes my whole application. This is the simple test code I used:

for (int i = 0; i < [pdfDoc pageCount]; i++)

{

 NSLog(@"Processing page %d/%d", i, [pdfDoc pageCount]);

NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init];

 PDFPage *page = [pdfDoc pageAtIndex:i];

NSRect mb = [page boundsForBox:kPDFDisplayBoxMediaBox];

NSRect cb = CalcCropBox(mb, 40, 60, 18, 18);

[page setBounds:cb forBox:kPDFDisplayBoxMediaBox];

NSPDFImageRep *pdfImgRep = [[NSPDFImageRep alloc] initWithData:[page
dataRepresentation]];

 [pdfImgRep release];

[localPool drain];

}


In the code, pdfDoc is a preloaded PDFDocument object. As seen from above,
I've released everything allocated, but in Instruments, this app keeps on
consuming memory.


So is this a bug in PDFKit? Or I'm not supposed to use it in this way?


Thanks.


Regards

Dairyknight
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSPDFImageRep Memory Leak?
      • From: John Calhoun <email@hidden>
    • Re: NSPDFImageRep Memory Leak?
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Meta Package in 10.5 to support 10.3 problem
  • Next by Date: Re: Meta Package in 10.5 to support 10.3 problem
  • Previous by thread: Re: Meta Package in 10.5 to support 10.3 problem
  • Next by thread: Re: NSPDFImageRep Memory Leak?
  • Index(es):
    • Date
    • Thread