Re: freeing an object whose clients have died unexpectantly



Hi Diego,

On Sat, 2001-12-29 at 16:51, Diego González wrote:
> 	i have a server that has to free the objets that are allocated to
> clients that die unexpectantly.

	Ok - sounds reasonable.

> (To detect when the client died i pass an object from the client to the
> server, and then i use the OBRit_small_listen_for_broken in that object)

	Sounds reasonable.

> 	When the client dies the callback is called, and i should free the
> object, to do this i have to do two bonobo_object_unrefs (because the
> client that died couldn't do the bonobo_object_unref by itself), which
> is ugly. Is there any other way to destroy an objet in this case?

	Sounds strange. Of course - this situation is not altogether ideal; it
depends what you want to do. It seems strange to me that the client
holds a ref and someone else does to.

	Are you sure that when the object is created you return:

	CORBA_Object_duplicate (BONOBO_OBJREF (obj), ev)

	rather than bonobo_object_dup_ref - ie. when you create an object it
has a single reference, you don't want to duplicate that as you pass it
off from a factory.

	Perhaps that is the problem - and you just want to release the object
once.

	Ultimately you want to try and decrement the reference count by as many
refs as you believe the connection entails - but ( of course ) it's
imperative that you 'unlisten' for the broken connection signal on that
connection when you release the object; otherwise you'll get notified
when the CORBA object dies (after the object has died) - really we could
do with a bonobo helper there to make that easier.

	So; I hope some of that was useful.

	Regards,

		Michael.



-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot




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