Hi Luke,<br>
<br>
thanks for your reply and support. Yes i understand the concept thanks, but i have tryed to add e remove reference after the  object  Activation POA  with<br>  <br>  test_p1_i * n=new test_p1_i;<br>  n-&gt;name(&quot;Alex&quot;);<br>
  test::p1_var ret=n-&gt;_this();<br>  n-&gt;remove_ref();<br>  return ret._retn();<br>  <br>in the client:<br><br> test::p1_var l=login-&gt;function();<br>  l-&gt;nome();<br>  orb-&gt;destroy();<br><br>also if i make :<br>
<br> test::p1_ptr l=login-&gt;function();<br> l-&gt;nome();<br> CORBA::release(l);<br>orb-&gt;destroy();<br><br>the object allocated from server is not be deallocated. however if in the server add another one n-&gt;_remove_ref();<br>
it be deallocated before return to client.<br>seem for the passing the object to client is added the reference another one... :(<br><br>maybe i had mistake in client caller?<br><br>Thanks <br>Regard<br>R!SC<br><br><br><br>
<br><div class="gmail_quote">2010/4/12 Luke Deller <span dir="ltr">&lt;<a href="mailto:ldeller@iress.com.au">ldeller@iress.com.au</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi R!SC,<br>
<br>
Sorry my explanation was not entirely accurate (though the solution was correct).  Here is an amended explanation.<br>
<div class="im">&gt;&gt; test_p1_i * n=new test_p1_i;<br>
</div>TThe above line constructs your servant, whose class is descended from whose class descends from PortableServer::ServantBase which supports reference counting. At this point there is one outstanding reference to the servant.<br>

<div class="im">&gt;&gt; test::p1_var ret=n-&gt;_this();<br>
</div>TThe above line will implicitly activate a CORBA object, so now there is a second reference to your servant owned by the POA.<br>
When you shut down the ORB or explicitly deactivate the object, the POA will release its reference to your servant.  However there is still the original reference outstanding, so the servant will leak as you have observed.<br>

<br>
My suggestion is to call n-&gt;_remove_ref() immediately after activating the object so that it will be deleted upon deactivation.<br>
<div><div></div><div class="h5"><br>
Regards,<br>
Luke.<br>
**********************************************************************************************<br>
Important Note<br>
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<br>

sender immediately and delete this email. Any views expressed in this email are not necessarily the views of IRESS Market Technology Limited.<br>
<br>
It is the duty of the recipient to virus scan and otherwise test the information provided before loading onto any computer system.<br>
IRESS Market Technology Limited does not warrant that the information is free of a virus or any other defect or error.<br>
**********************************************************************************************<br>
</div></div></blockquote></div><br>