• 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
NSImage leaks Help!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage leaks Help!


  • Subject: NSImage leaks Help!
  • From: Steve Gehrman <email@hidden>
  • Date: Fri, 16 Nov 2001 19:39:30 -0800

I've found memory leaks using NSImage. Does anyone know what I can do
to get around this? I'm loading an image, which could be a jpg or a pdf
or whatever, and calling lockFocus, unlockFocus to create a cached
image. I'm doing this so when when I go to draw it, it will draw
quickly. The problem is when I delete the image, the cached stuff is
not being released.

When run with MallocDebug, this code shows a bunch of things leaking.

Anyone know how to get around this?

NSImage* image = [[NSImage alloc]
initWithContentsOfFile:@"/Users/sgehrman/fuck.jpg"];

[image lockFocus];
[image unlockFocus];

[image release];

--
Steve Gehrman
CocoaTech, Inc.
email@hidden
http://www.cocoatech.com


  • Follow-Ups:
    • Re: NSImage leaks Help!
      • From: Andrew Platzer <email@hidden>
  • Prev by Date: Re: IB Palette with a Window
  • Next by Date: Re: scrolling an NSText to the bottom
  • Previous by thread: [ANN] MarshmallowLibrarian Public Beta 4
  • Next by thread: Re: NSImage leaks Help!
  • Index(es):
    • Date
    • Thread