[omniORB] CORBA::release()
Andrew Weaver
Andrew.Weaver@tecnomen.fi
Fri Sep 13 10:20:01 2002
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.