• 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
why does this leak?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

why does this leak?


  • Subject: why does this leak?
  • From: Robert Dell <email@hidden>
  • Date: Mon, 13 Feb 2006 18:41:04 -0500

if somebody tells me THIS is not a cocoa question, i'll simply stop getting this list.

I update my menus by first removing the items.  I used the following code:

  while ([mySingMenu numberOfItems] > 0)
    {
    [mySingMenu removeItemAtIndex: 0];
    };

From what i was told on this list, removing items from the list automatically releases them.  why is it i get 2 leaks per remove without a predeclared release as such?

  while ([mySingMenu numberOfItems] > 0)
    {
    [[mySingMenu itemAtIndex: 0] release];
    [mySingMenu removeItemAtIndex: 0];
    };

robert

_______________________________________________
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: why does this leak?
      • From: Charlton Wilbur <email@hidden>
    • Re: why does this leak?
      • From: Brett Powley <email@hidden>
    • Re: why does this leak?
      • From: Andy Armstrong <email@hidden>
  • Prev by Date: Orange County Cocoa-heads 2/14
  • Next by Date: Re: NSTableView
  • Previous by thread: Orange County Cocoa-heads 2/14
  • Next by thread: Re: why does this leak?
  • Index(es):
    • Date
    • Thread