Re: Weird retain Issue
Re: Weird retain Issue
- Subject: Re: Weird retain Issue
- From: Shawn Erickson <email@hidden>
- Date: Tue, 24 Feb 2004 15:13:20 -0800
On Feb 24, 2004, at 2:44 PM, Karl Goiser wrote:
Hello,
I wonder if anybody can explain this for me?
One object needs a reference to another object, so the first object's
init method contains a line like:
instanceVariable = [parameter retain];
Fairly standard stuff. Except that running ObjectAlloc shows that the
object being passed in doesn't ever get dealloc'ed. But if I change
the above line to (and make no other changes to the code):
instanceVariable = parameter;
[instanceVariable retain];
The object does get dealloc'ed.
I can almost 100% state that the above change is not the source of your
dealloc issue but something else in your code. You may have stumbled
across partially rebuilt project code that lead you to believe this
change resulted in a change of application behavior.
Of course if the object referenced by parameter has a broken retain
method, one that doesn't return self, then that is the source of your
issue (since the assumed release messages gets sent to the incorrect
object) but we cannot tell that without knowing more about the code,
what parameter could be, etc.
All we know is that you are retaining something and we have to assume
you are releasing it some place...
-Shawn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.