Re: [g-a-devel]checking Accessible* validity



Hi David,

On Wed, 2002-12-18 at 20:03, David Bolter wrote:
> Has anyone written (from the at-client perspective) a function to check 
> the validity of an Accessible*?

	Nope - there are varying levels of ease with which this can be done.
Ultimately the Accessible holds a remote reference on the object - so it
should be sufficient to check the ORB's socket connection between the
processes to see if the object is still 'alive' - would that suffice for
you ? [ it would be pretty easy to add some custom code to at-spi that
would emit a 'defunct' type event on every live at-spi Accessible when a
client crashed at the remote end - would that help ? ].

>   I think most of us clients are queueing and storing such pointers, and 
> it is possible to cause badness when they are defunct.

	Badness ? really ? what sort ? you should be able to reliably invoke
these methods in perpetuity without pathalogical failure - ok so you'll
get bogus roles [etc.] back, but ...

	I'm thinking of caching some of the details [ such as role-type ] so we
could use that to nicely flag /tag a defunct state perhaps for fast
polling.

>   I recently 
> noticed that gedit does not seem to emit the same defunct events for the 
> case where it is closed using the file - quit option as opposed to 
> pressing the close box.

	Strange.

> You should be able to confirm this using event-listener-test -m  in 
> at-spi/test

	And/or at-poke. I think we use children-changed there; are you using
at-poke [ it crashed for me last time I used it which is sad since I
spent so long trying to robustify it ;-].

> So given that objects can possibly go defunct without client knowledge, 
> is there a way a client can check the validity of its stored 
> Accessible*?  Or is it the case that we must deal with them when we pop 
> the queue and not store interfaces (e.g. Accessible*) to them longer 
> than that?

	My question is - why do you need to know ? :-) also are you using the
AccessibleEvent_ref / unref things to build your queue ? that's possibly
the best way to do things in today's world.

	HTH,

		Michael.

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




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