Usually self does not change, when the instance returned is different to the initially self then it is because the super init has decided that the initial self is not what it whats so it releases the initially self and returns a different object.

This can happen for singltons or cluster object or perhaps in a suation where the object represents some resource and if there is already an object for that resource the new instance is released and a retained version of the original instance is returned in its place.

On 04/12/2008, at 06:14 , EVS wrote:

self = [super init];

Why does the above line of code not cause a memory leak or memory fault?

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/nathan_day%40mac.com

This email sent to [EMAIL PROTECTED]

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to