Retain Count of NSConnection object

2010-01-04 Thread Alexander Reichstadt

Hi and happy new year,

I have a server and a client app using NSConnection.

All seems to work fine. The client is doing something like  
[(NSDistantObject *)aServer doThis] while the server object has a method


- (oneway void)doThis
{
NSLog(@do something);
}

After calling this method, the retain count I geton the client side  
when I call [[aServer connectionForProxy] retainCount] has increased  
by 3. Why I cannot understand at all. It doesn't do anything. Even if  
I empty the entire method doThis it increases and makes my client run  
out of memory eventually.


Is the server actually influencing the retainCount of its client's  
connectionForProxy, or is the retainCount something that every party  
has to look after on its own (which I thought would be the case)?


I can hardly expect for this to be a Cocoa-bug but imagine I am  
misunderstanding something. Can anyone help and please tell me where I  
am erring here?


Thanks a lot
Alex



smime.p7s
Description: S/MIME cryptographic signature
___

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 arch...@mail-archive.com

Re: Retain Count of NSConnection object

2010-01-04 Thread Sherm Pendley
On Mon, Jan 4, 2010 at 10:34 AM, Alexander Reichstadt l...@mac.com wrote:

 I can hardly expect for this to be a Cocoa-bug but imagine I am
 misunderstanding something. Can anyone help and please tell me where I am
 erring here?

You're expecting -retainCount to return a useful number. It doesn't.

Have a look at:
http://developer.apple.com/Mac/library/documentation/Performance/Conceptual/ManagingMemory/Articles/FindingLeaks.html

sherm--

-- 
Cocoa programming in Perl:
http://www.camelbones.org
___

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 arch...@mail-archive.com