I'm developing a Cocoa app, and every so often when running my app in Xcode I get the following sorts of messages in the debugging console:

> 
> `<`My app name`>`(952,0xb0103000) malloc: free\_garbage: garbage ptr = 0x107b2f0, has non-zero refcount = 1
> 
> 
> 

I turned on MallocStackLogging and NSZombieEnabled and did a malloc\_history on a couple of these addresses and got traces along the lines of that quoted at the bottom.

The common thread seems to be references to NSPopupButtonCell in all the blocks with the error.

My guess is that it's do to something being CFRetained somewhere but not released or made garbage collectable.

A) Is this more likely to be a programming error on my part or something in the framework that hasn't been properly updated for the GC yet?

B) What are the consequences of the issue provoking this message, if any? i.e. Do I need to pay attention to this message or can I just ignore it?

> 
> Call [2] [arg=48]: thread\_a003d720
>  |start | main | NSApplicationMain |
>  -[NSApplication run] | -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
>  | \_DPSNextEvent |
>  BlockUntilNextEventMatchingListInMode
>  | ReceiveNextEventCommon |
>  RunCurrentEventLoopInMode |
>  CFRunLoopRunInMode |
>  CFRunLoopRunSpecific |
>  \_\_CFRunLoopDoObservers | \_handleWindowNeedsDisplay | -[NSWindow displayIfNeeded] | -[NSView
>  displayIfNeeded] | -[NSView
>  \_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
>  | -[NSThemeFrame
>  \_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
>  | -[NSView
>  \_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
>  | -[NSView
>  \_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
>  | -[NSView
>  \_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
>  | -[NSView
>  \_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
>  | -[NSView
>  \_recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
>  | -[NSView
>  \_recursiveDisplayAllDirtyWithLockFocus:visRect:]
>  | -[NSView \_drawRect:clip:] |
>  -[NSControl drawRect:] | -[NSMenuItemCell drawWithFrame:inView:] |
>  -[NSPopUpButtonCell \_drawIndicatorWithFrame:inView:] | -[NSPopUpButtonCell \_indicatorFrameForCellFrame:inView:] | -[NSPopUpButtonCell \_indicatorFrameForCellFrame:isFlipped:]
>  | -[NSPopUpButtonCell
>  \_defaultIndicatorImage] | -[NSPopUpButtonCell \_coreUIDefaultIndicatorImage] | +[NSImage imageNamed:] | +[NSImage \_coreUIImageWithName:] | +[NSImage \_coreUIImageWithBaseName:state:backgroundStyle:]
>  | -[NSCoreUIImageRep
>  imageWithoutEffectsRect] |
>  SizeForImageOptions |
>  CUICopyMeasurements |
>  CUIRenderer::CopyMeasurements(CGRect,
>  CGContext\*, \_\_CFDictionary const\*,
>  \_\_CFArray const\*) | CUIRenderer::CopyImageMeasurements(long,
>  CUIContext const\*, \_\_CFArray const\*,
>  \_\_CFDictionary\*) | CreateImageSourceFromDisk(long,
>  CUIContext const\*, long\*, unsigned
>  char\*) |
>  CUISharedArtReader::CreateImageSource(long)
>  | CGImageSourceCreateWithDataProvider
>  | CGImageReadCreateWithProvider |
>  CGImageReadCreateWithData |
>  \_CGImageReadCreate | \_CFRuntimeCreateInstance | CFAllocatorAllocate |
>  auto\_zone\_allocate\_object Call [4]
>  [arg=0]: thread\_b0103000 |thread\_start
>  | \_pthread\_start |
>  auto\_collection\_thread(void\*) |
>  auto\_collect\_with\_mode(Auto::Zone\*,
>  unsigned int) |
>  auto\_collect\_internal(Auto::Zone\*,
>  int)
> 
> 
>