• 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: String memory leak
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String memory leak


  • Subject: Re: String memory leak
  • From: Bruce Truax <email@hidden>
  • Date: Sun, 02 Apr 2006 20:10:33 -0500
  • Thread-topic: String memory leak



On 4/2/06 10:44 AM, "Scott Ribe" <email@hidden> wrote:

>> I am obviously
>> doing something wrong so I guess it is time to go back and study the code
>> some more.
>
> Does setGlass retain the string? Does your dealloc method properly release
> it?

Yes it does.  Here is my getter and setter methods:

- (NSString *)glass {
    return [[glass retain] autorelease];
}

- (void)setGlass:(NSString *)newGlass {
    if (glass != newGlass) {
        [glass release];
        glass = [newGlass copy];
    }
}

Bruce


 _______________________________________________
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: String memory leak
      • From: Paul Forgey <email@hidden>
References: 
 >Re: String memory leak (From: Scott Ribe <email@hidden>)

  • Prev by Date: Re: Extracting file name & path from NSOpenPanel
  • Next by Date: Re: String memory leak
  • Previous by thread: Re: String memory leak
  • Next by thread: Re: String memory leak
  • Index(es):
    • Date
    • Thread