Discussion:
[omniORB] Memory leak in OmniORB version 4.0.1
Jaskirat Singh
2007-02-02 15:25:16 UTC
Permalink
Hello,



I'm using the following call to retrieve the interface name for Omni Orb
version 4.0.1.



poa->servant_to_reference(servant)->_PR_getobj()->_mostDerivedRepoId();



But I have seen through the memory leak detector tool that this is
resulting in a memory leak.

What will be the most appropriate fix for this.



Thanks,



JASKIRAT SINGH



Phone: 172.229.9416



CONFIDENTIALITY NOTICE
This e-mail transmission and any documents, files, or previous e-mail
messages appended or attached to it, may contain information that is
confidential or legally privileged. If you are not the intended
recipient, or a person responsible for delivering it to the intended
recipient, you are hereby notified that you must not read this
transmission and that any disclosure, copying, printing, distribution,
or use of the information contained or attached to this transmission is
STRICTLY PROHIBITED. If you have received this transmission in error,
please immediately notify the sender by telephone 172.229.9416 or return
e-mail message ***@quark.com and delete the original transmission,
its attachments, and any copies without reading or saving in any manner.
Thank you.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070202/87864046/attachment.htm
Jaskirat Singh
2007-02-02 15:30:34 UTC
Permalink
I'm using the following call to retrieve the interface name for Omni Orb
version 4.0.1.



poa->servant_to_reference(servant)->_PR_getobj()->_mostDerivedRepoId();



But I have seen through the memory leak detector tool that this is
resulting in a memory leak.

What will be the most appropriate fix for this?



Any help wil be much appreciated.



Thanks,



JASKIRAT SINGH



Phone: 172.229.9416



CONFIDENTIALITY NOTICE
This e-mail transmission and any documents, files, or previous e-mail
messages appended or attached to it, may contain information that is
confidential or legally privileged. If you are not the intended
recipient, or a person responsible for delivering it to the intended
recipient, you are hereby notified that you must not read this
transmission and that any disclosure, copying, printing, distribution,
or use of the information contained or attached to this transmission is
STRICTLY PROHIBITED. If you have received this transmission in error,
please immediately notify the sender by telephone 172.229.9416 or return
e-mail message ***@quark.com and delete the original transmission,
its attachments, and any copies without reading or saving in any manner.
Thank you.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070202/e4f1dc9d/attachment.htm
Luke Deller
2007-02-03 16:46:39 UTC
Permalink
Hi Jasjirat,

Your code leaks the CORBA::Object_ptr returned by
servant_to_reference(servant). This kind of problem can be avoided by
using the relevant _var convenience class to handle its cleanup, eg:
CORBA::Object_var obj = poa->servant_to_reference(servant);

BTW I don't think you actually need to call servant_to_reference... it
looks like you can call _mostDerivedRepoId() on the servant:
servant->_mostDerivedRepoId();

This is omniORB specific, but so is the use of _PR_getobj() in the code
which you proposed. The standard-compliant way to do this would be to
call _get_interface() on the servant, but that requires the use of an
interface repository which is not built into omniORB.

Regards,
Luke.
**********************************************************************************************
Important Note
This email (including any attachments) contains information which is confidential and may be subject to legal privilege. If you are not the intended recipient you must not use, distribute or copy this email. If you have received this email in error please notify the
sender immediately and delete this email. Any views expressed in this email are not necessarily the views of XPlan Technology.

It is the duty of the recipient to virus scan and otherwise test the information provided before loading onto any computer system.
Xplan Technology does not warrant that the information is free of a virus or any other defect or error.
**********************************************************************************************
Loading...