• 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
printShowingPrintPanel & memory leak
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

printShowingPrintPanel & memory leak


  • Subject: printShowingPrintPanel & memory leak
  • From: Craig Hopson <email@hidden>
  • Date: Thu, 24 Aug 2006 14:02:21 -0600

Doing some performance testing, checking for memory leaks, etc. MallocDebug reports a memory leak in our app which is traced to printShowingPrintPanel. I have confirmed that the view(s) we create for the print operation are begin dealloc-ed. There is no other memory allocations by our application (that I can find). I assume that since NSPrintOperation printOperationWithView: is a convenience method it properly autoreleases the printOperation. (And, I did try to release it myself with predictable bad results.)

So basically the code does the following:

NSPrintInfo* printInfo = [ self printInfo ];
// do some calculations to get the max print area (min margins) and set them into printInfo


NSView* printableView = [ self printableView ];
NSPrintOperation* printOp = [ NSPrintOperation printOperationWithPrintView:printableView printInfo:printInfo ];
[ printOp setShowPanels:flag ];
[ self runModalPrintOperation:printOp delegate:self didRunSelector:@selector(documentDidRunModalPrintOperation: success: contextInfo:) contextInfo:nil ];


This leaks 520K with every print job.

Anyone see what I'm missing?


Craig Hopson Red Rock Software



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: printShowingPrintPanel & memory leak
      • From: Craig Hopson <email@hidden>
  • Prev by Date: [Moderator] EOT Re: Help Button - where to place it
  • Next by Date: Re: Links in NSTextField
  • Previous by thread: Fwd: wierd behaviour of NSTreeController selectedObjects
  • Next by thread: Re: printShowingPrintPanel & memory leak
  • Index(es):
    • Date
    • Thread