From: Panayotis K. <pan...@pa...> - 2010-03-11 16:50:21
|
On 11 Μαρ 2010, at 6:09 ΜΜ, Arno Puder wrote: > > right now we have the rule that ownership of an object that is > returned > as a result of a method invocation is passed to the caller. That is > why > we have as a general rule a retain on references when returning them. > The caller then decides what it wants to do with the reference. If the > caller ignores the result (which the callee cannot know) it will do a > release. > > I will be adding a patch in the next few days that will get rid of > NSAutoreleasePool. Those memory management rules won't change, but the > code should be much more efficient. > > Arno So, practically it is always important to "retain" the object when creating the objective-c library connection with java, right? I am asking this because I am working on a patch which will take care of nil objects returned by various property glue functions, and I want to make clear that it's a _rule_ to always retain an object before returning it. |