[omniORB-dev] Re: Object::_get_interface() always returns nil ref - PATCH

Alex Tingle alex at firetree.net
Tue Mar 30 10:14:41 BST 2004


I wrote:
> I'm working on `omniifr' an implementation of the Interface
> Repository. The first draft is very nearly complete, but I'm having
> trouble with omniORB's implementation of the Object::_get_interface()
> method - it always returns a nil reference!

I've attached a patch for this bug.

Summary: The bug was this line of code:
  return call_desc.result() ? call_desc.result()->_PR_getobj() : 0;

omniStdCallDesc::_cCORBA_mObject_i_cstring::result() should only be
called once, as it empties the _var that stores the result. Obviously
this line calls it twice, and so the second call always returns NULL.

Thanks to Duncan for helping me find this. I should be able to release
the first version of the new omniIFR now.

-Alex Tingle
-------------- next part --------------
Index: src/lib/omniORB/orbcore/portableserver.cc
===================================================================
RCS file: /cvsroot/omniorb/omni/src/lib/omniORB/orbcore/Attic/portableserver.cc,v
retrieving revision 1.2.2.11
diff -c -r1.2.2.11 portableserver.cc
*** src/lib/omniORB/orbcore/portableserver.cc	16 Jan 2002 11:32:00 -0000	1.2.2.11
--- src/lib/omniORB/orbcore/portableserver.cc	30 Mar 2004 07:45:58 -0000
***************
*** 323,329 ****
      call_desc(omniDynamicLib::ops->lookup_id_lcfn, "lookup_id", 10, repoId);
    repository->_PR_getobj()->_invoke(call_desc);
  
!   return call_desc.result() ? call_desc.result()->_PR_getobj() : 0;
  }
  
  
--- 323,330 ----
      call_desc(omniDynamicLib::ops->lookup_id_lcfn, "lookup_id", 10, repoId);
    repository->_PR_getobj()->_invoke(call_desc);
  
!   CORBA::Object_ptr result =call_desc.result();
!   return result? result->_PR_getobj(): 0;
  }
  
  


More information about the omniORB-dev mailing list