[omniORB] activate_object

Duncan Grisby duncan@grisby.org
Tue, 07 May 2002 20:59:49 +0100


On Tuesday 7 May, yashik@veon.com wrote:

> PortableServer::ObjectId_var oid = m_POA->activate_object(my_servant);
> CORBA::Object_var obj = m_POA->id_to_reference(oid.in());
> 
> Unfortunately, I get a crash as soon as 'oid' variable gets out of scope.
> Adding
>      oid._retn();
> after id_to_reference call corrects the problem, but this looks like a
> potential problem: if the exception is thrown before the oid._retn() call,
> the variable will be released, causing the crash.

Almost certainly, you are using Windows, and the crash is something
about crtIsValidHeapPointer. If so, the problem is that you are mixing
debug application code with non-debug versions of the omniORB
libraries. Windows doesn't like that. Make sure you always match
debugging options.

If that isn't the problem, what platform are you using, and what
exactly happens in the crash?

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan@grisby.org     --
   -- http://www.grisby.org --