• 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
Debugging suggestion for memory leak?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Debugging suggestion for memory leak?


  • Subject: Debugging suggestion for memory leak?
  • From: Rich Long <email@hidden>
  • Date: Sun, 21 Apr 2002 12:23:19 -0400

Hi,

I'm a Cocoa newbie and having a bit of a thorny problem. I have a lengthy operation that I run in a thread, and as part of that I put up a progress dialog. The trick is that the progress dialog is implemented as a "stack" on a single panel, so as other parts of the code (within the thread) invoke a progress dialog, the panel state (labels, etc.) is remembered and the panel reused. As each instance of the stacked panel is unwound, the previous state of the panel is restored, and the last instance releases the panel. I do create and release an autorelease pool within the thread.

This is working OK, but I get this message consistently:

*** _NSAutoreleaseNoPool(): Object 0x220310 of class NSCalibratedRGBColor autoreleased with no pool in place - just leaking

I believe this is tied to my "stacking" code, because if I convert to using individual progress panels, it all works fine. I'm guessing it's a problem with retaining, releasing, and autoreleasing, but I'm not sure where to start.

I'd appreciate any debugging suggestions so I could see where this is happening... I'm new to gdb as well, so please type slowly. :-)

Thanks,
Rich

p.s. The layout is as follows: I have a nib which defines the progress panel (NSPanel) with two labels, a progress bar, and stop button. I have a controller class (NSObject subclass), which has outlets for the UI elements, and a stop method. The panel is set to release when closed.

The controller class loads the nib in its init method and sets owner to self.

I have another class which implements the stack. It has the panel controller class as a static member (allocated on first invocation). It has member variables to store the value of the two labels and the state of the button (enabled or not). In the init method, it stores the state, and in the dealloc method, the state is restored. When the first invocation is released, so is the panel controller.
_______________________________________________
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.
  • Follow-Ups:
    • Re: Debugging suggestion for memory leak?
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: SOLVED Re: Setting divider position of NSSplitView?
  • Next by Date: Re: releasing a NSArray
  • Previous by thread: SOLVED Re: Setting divider position of NSSplitView?
  • Next by thread: Re: Debugging suggestion for memory leak?
  • Index(es):
    • Date
    • Thread