printShowingPrintPanel & memory leak
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