+ if(p_ref)
+ {
+ // do not delete CORBA servant : deactivate it and then call _remove_ref or delete
+ PortableServer::ServantBase* servant=dynamic_cast<PortableServer::ServantBase*>(p_ref);
+ if(servant)
+ {
+ PortableServer::POA_var poa =servant->_default_POA();
+ PortableServer::ObjectId_var oid = poa->servant_to_id(servant);
+ poa->deactivate_object(oid);
+ servant->_remove_ref();
+ }
+ }