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

Re: why does this leak?


  • Subject: Re: why does this leak?
  • From: Brett Powley <email@hidden>
  • Date: Tue, 14 Feb 2006 11:27:57 +1100

How did you allocate them and insert them into the array? Maybe you did an extra retain. You might want to add something like

NSLog( @"mySingMenu retainCount=%d", mySingMenu itemAtIndex: 0] retainCount] );

to check this.

On 14/02/2006, at 10:41 AM, Robert Dell wrote:

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:
40process.com.au


This email sent to email@hidden


-------------------------------------------------------------- Brett Powley -- PhD Candidate Centre for Language Technology, Macquarie University, Australia p: +61-402-013050 f: +61-2-90120813 e: email@hidden w: http://www.ics.mq.edu.au/~bpowley faciendi plures libros nullus est finis frequensque meditatio carnis adflictio est --------------------------------------------------------------



_______________________________________________
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


References: 
 >why does this leak? (From: Robert Dell <email@hidden>)

  • Prev by Date: Re: why does this leak?
  • Next by Date: Orange County Cocoa-heads conflicts with major holiday, film at 11!
  • Previous by thread: Re: why does this leak?
  • Next by thread: Re: why does this leak?
  • Index(es):
    • Date
    • Thread