Re: -[NSView dataWithPDFInsideRect:] leaks
Re: -[NSView dataWithPDFInsideRect:] leaks
- Subject: Re: -[NSView dataWithPDFInsideRect:] leaks
- From: Esteban Uribe <email@hidden>
- Date: Thu, 18 Apr 2002 17:08:22 -0700 (PDT)
You might want to try retainig the NSData you get from dataWithPDFInsideRect and the release it when you are done.
It might be be apparently leaking it because it is being autoreleased, so you have to wait until the pool releases it.
On Thursday, April 18, 2002, at 11:56PM, Peter Sichel <email@hidden> wrote:
>
My application includes a window that plots network throughput
>
within a subclass of NSView. I'd like to make the plot within
>
this NSView appear as the miniaturized Dock image when the window
>
is miniaturized.
>
>
The code below works, but leaks from -dataWithPDFInsideRect
>
>
if ([[self window] isMiniaturized]) {
>
NSImage* anImage;
>
NSData* pdfData;
>
// get the desired image
>
pdfData = [plotView dataWithPDFInsideRect:[plotView bounds]];
>
anImage = [[NSImage alloc] initWithData:pdfData];
>
[[self window] setMiniwindowImage:anImage];
>
[anImage release];
>
}
>
>
Can anyone suggest a better way to convert an NSView (in a miniaturized
>
window) to an NSImage that doesn't leak so much?
>
>
Thanks!
>
>
- Peter
>
--
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.