[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mico-devel
Subject:    Re: [mico-devel] problem with ORB singleton (mico 2.3.11)
From:       Karel Gardas <kgardas () objectsecurity ! com>
Date:       2005-08-26 9:10:16
Message-ID: Pine.LNX.4.63.0508261107460.5176 () silence ! gardas ! net
[Download RAW message or body]

On Thu, 25 Aug 2005, Egon Teiniker wrote:

> Hello!
>
> In orb/orb.cc (line 585) the ORB singleton "orb_instance" is a variable
> of type "ORB_ptr". ORB_init and ORB_instance are always returning
> "duplicate(orb_instance)", so the reference count of the resulting
> object will always be greater than one. If I assign this object to
> variables of type "ORB_var", the counter goes up and down, but will
> never reach zero. As a result the global ORB singleton will never be
> destroyed (not even at the end of the program).
>
> In my opinion we could easily fix this bug be implementing the singleton
> as a variable of type "ORB_var".

I'm afraid you are not right. We use _ptr type to be able to release 
reference in CORBA::ORB::destroy method, so if you use something like:

{
   ORB_var orb = ORB_init(...);
   orb->destroy();
}

then ORB instance is destroyed at the end of the block.

Cheers,
Karel
--
Karel Gardas                  kgardas@objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com
---
Need experienced, fast, reliable technical MICO support?
     ---> http://www.objectsecurity.com/commsup.html  <---
---
_______________________________________________
Mico-devel mailing list
Mico-devel@mico.org
http://www.mico.org/mailman/listinfo/mico-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic