[omniORB] resolve_initial_references and ref counting : bug ?
Duncan Grisby
dgrisby@uk.research.att.com
Wed, 17 Oct 2001 18:25:56 +0100
On Wednesday 17 October, Brecht Vermeulen wrote:
> I spent some time searching for non-released object references in my
> code (omni4 says '2 object references present at ORB shutdown' with
> ORBtraceLevel 15) and I think the reference returned by
> resolve_initial_references("Nameservice") is badly counted :
The counting is correct. The two references present at shutdown are the
Echo object and the root NamingContext. The Echo is still there since
its _var hasn't gone out of scope when shutdown() is called. The
NamingContext is more interesting.
What happens is that the first time you call
resolve_initial_references for a particular key, the resulting object
reference is remembered for future use. This saves repeatedly
performing the resolution, which might be quite costly. These stored
references are not released until the ORB is being destroyed, which
happens after shutdown, so shutdown reports the presence of the
references. It's nothing to worry about.
I've added some extra tracing at traceLevel 25 that prints out the
repository id and identity of the objects remaining at shutdown, to
give slightly more of a hint about what's going on.
Cheers,
Duncan.
--
-- Duncan Grisby \ Research Engineer --
-- AT&T Laboratories Cambridge --
-- http://www.uk.research.att.com/~dpg1 --