• 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
Re: -[NSView dataWithPDFInsideRect:] leaks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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] initWithData: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:toData:printInfo:]
+[NSConcretePrintOperation PDFOperationWithView:insideRect:toData: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.

References: 
 >Re: -[NSView dataWithPDFInsideRect:] leaks (From: Ondra Cada <email@hidden>)

  • Prev by Date: How to hide a window?
  • Next by Date: Rect of NSView to a NSImage
  • Previous by thread: Re: -[NSView dataWithPDFInsideRect:] leaks
  • Next by thread: Re: Porting a Win app to MAC 10
  • Index(es):
    • Date
    • Thread