Newbie questions + bug report...



Hi all, I am a newbie to CORBA and ORBit, so please excuse any 
irrelevant ramblings...

I am busy converting an application to a CORBA framework, using ORBit. 
The conversion worked well and remarkably easily, so thanks to all ORBit 
developers for a great system.

Now, a small bug report... In versions 2.7.5 and 2.7.6 (possibly 
previous releases too), there is a small bug in orbit-adaptor.c, in 
function ORBit_ObjectAdaptor_set_thread_hint, 
ORBit_ObjectAdaptor_set_thread_hint is called, instead of 
ORBit_ObjectAdaptor_set_thread_hintv, leading to an instant SEGFAULT any 
time it is called...

Now for my problem: Using a simple, single threaded model, everything 
works fine.  However, changing it to a multithreaded model creates 
problems.  I use ORB_CTRL_MODEL and a THREAD_PER_OBJECT hint, together 
with a factory.  This works well, each produced object runs in its own 
thread, and all is well, however, I have no idea how to create a 
destructor for the server side object.  If I call:
impl_Echo_Echo__destroy(servant, ev);
in the destructor, the objects memory is freed, but it remains 
registered with the POA, so shutting down the main ORB results in a 
segfault when the POA tries to release the object.  If I call:
PortableServer_POA_deactivate_object(servant->poa, objid, ev);
in the destructor, everything seems to work fine (even the __destroy 
method is called by the POA), _but_ the system leaks memory.

What is the correct way to destroy a server side object?

Also, how do you shut down the ORB cleanly in a multi-threaded 
environment?  I use the signal handlers as in the examples, but this 
gives an error that shudwon must be called from the main thread... Hiw 
do I get around this?

Thanks for any help/advice you may be able to give.

-justin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]