Re: Leaking Mach Ports?
Re: Leaking Mach Ports?
- Subject: Re: Leaking Mach Ports?
- From: Dirk Musfeldt <email@hidden>
- Date: Fri, 11 Mar 2005 12:22:16 +0100
Chris,
>> One other thing is our use of the CFMessagePort communication. Every
>> call to
>> CFMessagePortCreateRemote() as well as some other calls from the
>> CFMessagePort suite increases the number of send rights for a special
>> port,
>> but CFRelease() doesn't lower it again. Is that expected behaviour?
>
> Are you also detaching and releasing the runloop sources associated
> with the message port? I believe those might add a retain to the
> message port and therefore prevent the mach port from being released...
At least for some message ports there are no runloop sources associated.
This is a one-shot message:
CFMessagePortRef portRef = CFMessagePortCreateRemote( kCFAllocatorDefault,
portNameRef);
if (NULL != portRef) {
// we have found valid client port
if (CFMessagePortIsValid(portRef)) {
success = CFMessagePortSendRequest ( portRef, kMyMessageID,
sendDataRef, kSendTimeout, kReceiveTimeout, NULL, NULL);
CheckError( success);
}
CFRelease(portRef);
}
After stepping through this code the number of send rights remain increased.
Is there anything wrong with this code?
Regards
Dirk
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden