[omniORB] vety basinc BOA question

Attila.Pletyak@anemo.com Attila.Pletyak@anemo.com
Fri, 15 Feb 2002 12:15:54 +0100


I'm ususally doing the following for initializing BOA:

int main( int argc, char** argc )
{
  CORBA::ORB_var orb = CORBA::ORB_init( argc, argv, "omniORB3" );
  CORBA::BOA_var boa = orb->BOA_init( argc, argv, "omniORB3_BOA");

  ...

}

Sincerely,

Attila Pletyak
  Anemo Ltd., Osztrovszky u. 17/b., Szeged H-6721, Hungary
  Phone: (+36 62) 452-223           Fax: (+36 62) 452 223
  mailto: attila.pletyak@anemo.com
  http://www.anemo.com/                http://www.ion.hu/













     To:  <omniorb-list@uk.research.att.com>
     cc:
     bcc:
     Subject:  [omniORB] vety basinc BOA question
"Ivan Ivanov" <Ivan.Ivanov@trema.com>
Sent by: owner-omniorb-list@uk.research.att.com
02/15/2002 11:47 AM
          <font size=-1></font>



















Hello everyone,

Very often one could see a code snippet containing the line:
my_implementation->_obj_is_ready (CORBA::BOA::getBOA ());

The getBOA() function returns a new reference (with duplicating BOA_ptr)

which is never released as far as I can understand it.



Wouldn't be this more appropriate:

  CORBA::BOA_var boa = CORBA::BOA::getBOA ();
  my_implementation ->_obj_is_ready (boa);

as the _var automatically will release the reference to the
CORBA::BOA object?

Is there a memory leak in the first case?
Thanks,
Ivan