[omniORB] CORBA::release()

baileyk@schneider.com baileyk@schneider.com
Fri Sep 13 14:24:00 2002


When using the _var types, you should not call release().  The destructor,
assignment operator, and copy constructor of the _var types handle the ref
counting.

Kendall



                                                                                                                       
                    Andrew Weaver                                                                                      
                    <Andrew.Weaver@tecnomen.fi>        To:     "'omniorb'" <omniorb-list@realvnc.com>                  
                    Sent by:                           cc:                                                             
                    omniorb-list-admin@omniorb-s       Fax to:                                                         
                    upport.com                         Subject:     [omniORB] CORBA::release()                         
                                                                                                                       
                                                                                                                       
                    09/13/2002 04:19 AM                                                                                
                                                                                                                       
                                                                                                                       




Moi, I am trying to implement a "watchdog" functionality whereby a process
can "ping" other applications to see if they are still alive.

Each of the target apps implements an "ApplicationAdminIntf" interface that
supports a method called "Ping". This method simply returns void. So, if
the
watchdog gets a successful call to the target, it assumes that all is OK.

The watchdog has a list of the IORs for each of the targets and
periodically
checks them out.

The code in use for this is shown below and it appears to work fine.
However, if I do
CORBA::release(AdminRef); after the successful "Ping", I get a message
saying that I am attempting to release an object when the ref count is <=
0.

Based on my own tracing, this message appears when I try to create a new
ref
after having pinged 3 or 4 applications already.


CORBA::Object_var AdminObj;
Admin::ApplicationAdminIntf_var AdminRef;

... loop starts ...

AdminObj = TheOrb->string_to_object(TheIOR);
AdminRef = Admin::ApplicationAdminIntf::_narrow(AdminObj);
if (CORBA::is_nil(AdminRef)) {
    ... some error processing and continue the loop ...
}
AdminRef->Ping();
**** Doing CORBA::release(AdminRef); here triggers the errors ****
... continue the loop ...

Kind Regards

Andy Weaver

"But to live outside the law ya must be honest..." R. Zimmerman.

_______________________________________________
omniORB-list mailing list
omniORB-list@omniorb-support.com
http://www.omniorb-support.com/mailman/listinfo/omniorb-list