Please report new issues athttps://github.com/DOCGroup
_this() is implemented in terms of Servant_Base::_create_stub(). After obtaining a TAO_Stub from the Servant_Base _this() allocates a CORBA::Object (see bug 1489 about some problems with that.) However, the implementation of _create_stub() *already* created a CORBA::Object, but it chooses to unwrap the TAO_Stub and return *that*. The code would be much more efficient, and shorter, if Servant_Base had a _this_impl() method that returned the CORBA::Object_ptr directly, then the _this() method would only need to use _narrow. I do not know if _create_stub() is used anywhere else, but a cursory inspection indicates that it is not, if so, it can be completely removed.
Accepted.