Re: -[NSView dataWithPDFInsideRect:] leaks
Re: -[NSView dataWithPDFInsideRect:] leaks
- Subject: Re: -[NSView dataWithPDFInsideRect:] leaks
- From: Peter Sichel <email@hidden>
- Date: Fri, 19 Apr 2002 10:15:43 -0400
At 11:47 PM +0200 4/18/02, Ondra Cada wrote:
On Thursday, April 18, 2002, at 08:11 , Peter Sichel wrote:
The code below works, but leaks from -dataWithPDFInsideRect
You sure it's a leak (and not just a cache)?
---
Ondra Cada
Yes, the leaks are clearly visible in MallocDebug.
Changing the code to this made no difference:
if ([[self window] isMiniaturized]) {
NSImage* anImage;
NSData* pdfData;
NSAutoreleasePool *pool;
pool = [[NSAutoreleasePool alloc] init];
// get the desired image
pdfData = [plotView dataWithPDFInsideRect:[plotView bounds]];
[pdfData retain];
anImage = [[NSImage alloc] initWith
Data:pdfData];
[[self window] setMiniwindowImage:anImage];
[anImage release];
[pdfData release];
[pool release]; // releases all autoreleased
objects including pdfData
}
In MallocDebug "Definite Leaks" shows a number of 40 byte
blocks while getting and parsing the device plist as follows:
320 bytes in 8 nodes:
malloc
CFAllocatorAllocate
_CFRuntimeCreateInstance
__CFDictionaryInit
CFDictionaryCreateMutable
parseDictTag
parseXMLElement
getContentObject
parseDictTag
parseXMLElement
getContentObject
parseArrayTag
parseXMLElement
getContentObject
parseDictTag
parseXMLElement
getContentObject
parseDictTag
parseXMLElement
getContentObject
parseDictTag
parseXMLElement
getContentObject
parsePListTag
parseXMLElement
parseXMLPropertyList
_CFPropertyListCreateFromXMLData
_loadXMLDomainIfStale
fetchXMLValue
_CFPreferencesDomainCreateValueForKey
CFPreferencesCopyValue
GetDevicePList
GetNextDeviceList
GetDefaultDeviceDict
CMGetDefaultDevice
CMGetDeviceTrackingByUse
CMGetDefaultProfileByUse
PJCCopyColorSyncSystemProfilePath
PJCDefaultPrintSettings
PMSessionDefaultPrintSettings
-[NSPrintInfo _initPrivData]
-[NSPrintInfo _initWithDictionary:pageFormat:printSettings:]
-[NSPrintInfo copyWithZone:]
-[NSConcretePrintOperation initWithView:printInfo:]
-[NSConcretePrintOperation
initEPSOperationWithView:insideRect:to
Data:printInfo:]
+[NSConcretePrintOperation PDFOperationWithView:insideRect:to
Data:printInfo:]
+[NSConcretePrintOperation PDFOperationWithView:insideRect:toData:]
+[NSPrintOperation PDFOperationWithView:insideRect:toData:]
-[NSView(NSPrinting) dataWithPDFInsideRect:]
Any more ideas?
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.