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



Thanks Michael:

Michael Meeks wrote:

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 ? ].

That should help actually. I think it could potentially be a good thing for many at-spi clients, but I am not aware of the efficiency costs.



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 ...

The example is that gok seg faults (when it tries an Accessible_getName ([accessible for defunct object]); I am not sure why it seg faults. Note that the process space for gedit is gone at this point.



	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 think I understand you here, but if the cache is finite then there is still no gaurantees...


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 ;-].

at-poke seems to be working for me...  but does it log events?


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.

I am still using Accessible_ref and Accessible_unref on the event->source. I have been on leave for a few months and am a little out of the loop. Should I be using AccessibleEvent_ref/unref? Note, I am doubtful that will solve this particular issue.


	HTH,

		Michael.


cheers,

David




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