• 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
When init returns nil does it cause a leak
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

When init returns nil does it cause a leak


  • Subject: When init returns nil does it cause a leak
  • From: Reza Farhad <email@hidden>
  • Date: Tue, 19 May 2009 17:24:39 +0100

Hi all

we have an object that gets initialized like most other objects

-(id)init
{
	self = [ super init ];
	if ( self ){
		...do something;
	}
	return self;
}

if [ super init ] returns nil does this cause a leak, as the memory has already been created by calling alloc when trying to create the object

AnObject	*object = [[ AnObject alloc ] init ];

I am sure the answer is simple but this suddenly stumbled me.

Thanks

Reza








_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: When init returns nil does it cause a leak
      • From: Jean-Daniel Dupas <email@hidden>
    • Re: When init returns nil does it cause a leak
      • From: Jesper Storm Bache <email@hidden>
  • Prev by Date: Re: Distinguish Pending Text from Committed Text
  • Next by Date: Re: Distinguish Pending Text from Committed Text
  • Previous by thread: Re: [NSApp presentError:error] & Custom Icon ...
  • Next by thread: Re: When init returns nil does it cause a leak
  • Index(es):
    • Date
    • Thread