Re: Object::_get_interface() always returns nil ref - PATCH
Alex Tingle <[email protected]> Tue, 30 Mar 2004 09:14:41 +0100
| Newsgroups | gmane.comp.corba.omniorb.devel |
|---|---|
| Message-ID | <[email protected]> |
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 _______________________________________________ omniORB-dev mailing list [email protected] http://www.omniorb-support.com/mailman/listinfo/omniorb-dev
portableserver.cc.patch.txt
(text/plain, 918 B)
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;
}