• 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
Releasing an unretained menu item?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Releasing an unretained menu item?


  • Subject: Releasing an unretained menu item?
  • From: jjoonathan <email@hidden>
  • Date: Tue, 01 Mar 2005 17:12:57 -0700

Ok, I have a program that displays a menu in the status bar. Every once in awhile, it has to refresh, delete all the old items, and put new ones in. This works fine 99% of the time, but after awhile ( the amount of time varies), the loop that releases each object in the menu gets this error (for every item in the menu, and the address is naturally different for each error):

*** malloc[506]: Deallocation of a pointer not malloced: 0x1abe630; This could be a double free(), or free() called with the middle of an allocated block; Try setting environment variable MallocHelp to see tools to help debug

What is this? Does NSMenu for some reason not retain it's items (the ones right before it crashes work fine out of the update method so they must be retained)? What is going on? Again, the error seems to randomly spring up. Any help would be appreciated!



jjoonathan

PS
Is there any way to catch errors, and say, display a dialog with the error in it and abort the method that threw it, instead of having the whole program crash?



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Releasing an unretained menu item?
      • From: "Sean McBride" <email@hidden>
  • Prev by Date: Help: How to show an application again after 5 days?
  • Next by Date: setting a text storage object
  • Previous by thread: Re: Help: How to show an application again after 5 days?
  • Next by thread: Re: Releasing an unretained menu item?
  • Index(es):
    • Date
    • Thread