Just an idea, will ARC work?

在 2013-2-5,下午5:20,Riccardo Mottola <[email protected]> 写道:

> Hi,
> 
> when writing the server side with DO I do (since I copied it from the 
> examples I found around the net, including our tutorial):
> 
>    // we set up distributed objects
>    port1 = [NSPort port];
>    port2 = [NSPort port];
>    kitConnection = [[NSConnection alloc] initWithReceivePort:port1
> sendPort:port2];
>    [kitConnection setRootObject:self];
> 
> the kitConnection is a local variable to the method which does nto get 
> released, thus the compiler will complain that it is leaked.
> Now I do wonder, shouldn't it be released? Some examples put in an extra 
> "retain" even, surely useless, since it is an alloc'd object.
> If it should be released when? Perhaps it is wrong or "dirty" to put this 
> connection in an method-local variable and for cleaniness it should be an 
> ivar and released on object deallocation (= essentially never, since in my 
> case it is the App Controller).
> 
> 
> Riccardo
> 
> _______________________________________________
> Gnustep-dev mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/gnustep-dev


_______________________________________________
Gnustep-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to