• 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: Release understanding help Š
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Release understanding help Š


  • Subject: Re: Release understanding help Š
  • From: mark <email@hidden>
  • Date: Mon, 06 Dec 2004 18:32:53 -0800

I thought maybe that was the problem, thanks!

And thanks for the one (big line!) solution!

Mark

> the problem line is here:
>
> validChars = [validChars stringByAppendingString:[[NSUserDefaults
> standardUserDefaults] objectForKey:NSDecimalSeparator]];
>
> you are reassigning a new NSString that is autoreleased by the
> stringByAppendingString method and are leaking memory of the original
> string. You could initialize validChars like the following to fix it:
>
> NSString * validChars = [[NSString alloc] initWithFormat :
> @"%@%@",@"0123456789mc/'\" ",[[NSUserDefaults standardUserDefaults]
> objectForKey:NSDecimalSeparator]];
> //and remove the following line :
> //validChars = [validChars stringByAppendingString:[[NSUserDefaults
> standardUserDefaults] objectForKey:NSDecimalSeparator]];
>
> The same applies for disallowedCharacters. It's an autoreleased object
> already so releasing it isn't safe. The same also applies for any
> "static"/ class methods. You only release an object you have allocated
> or retained .
>
>
>
> not sure what the "#if 0 ", is for but it doesn't look very safe. I
> would remove it :)
I have now that it works :)

 _______________________________________________
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: 
 >Re: Release understanding help… (From: Byron Wright <email@hidden>)

  • Prev by Date: Re: Release understanding help…
  • Next by Date: Re: What are the numbers the represent the finder window view modes?
  • Previous by thread: Re: Release understanding help…
  • Next by thread: Re: Release understanding help…
  • Index(es):
    • Date
    • Thread