Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atspi: do we need to keep track of "when a AtspiAccessible has been killed by the application" #222

Open
spectranaut opened this issue May 9, 2024 · 3 comments

Comments

@spectranaut
Copy link
Contributor

For example, Orca does it here: https://github.com/GNOME/orca/blob/34ba2393fc64c0e82f47da3900c7de398a89c2cb/src/orca/ax_object.py#L162

For use, we need to know when an object has been killed as well. Should we check preemptively, in IsNull? otherwise, will we throw a specific error every time? Seems a little annoying, because you will have to try/catch for whether the object still exists every time you use it.

@spectranaut
Copy link
Contributor Author

spectranaut commented May 9, 2024

Notes:

  • when the node no longer exists (the web pages changes), we get getRoleName() == invalid
    • do we get role = invalid in other scenarios?
    • seems like this might be browser specific.
  • when you kill an application (like chrome), then try to use the accessible for the root, get child count return -1
    • does this happen at other times?
  • when you kill an application and try to get the attributes, you get a seg fault, which we can fix:
    (process:1140712): GLib-CRITICAL **: 12:09:21.592: g_hash_table_iter_init: assertion 'hash_table != NULL' failed Segmentation fault

@spectranaut
Copy link
Contributor Author

Probably this won't happen frequently in testing, but it's still worth thinking about a little bit more.

@spectranaut spectranaut changed the title Atspi: we need to keep track of "when a AtspiAccessible has been killed by the application" Atspi: do we need to keep track of "when a AtspiAccessible has been killed by the application" May 14, 2024
@alice
Copy link
Contributor

alice commented May 15, 2024

I think maybe we can do something like #226 here too - i.e. have the toString() method never throw/crash.

I like the idea of folding checking for dead-ness into isNull() - maybe then if it is dead, you could set the internal pointer to null as well, so future calls to isNull() will just return true without needing to check for deadness.

I guess we already somewhat handle dead-ness given that we throw a runtime error if we get an error back from one of the library functions, so maybe we just need to do what Orca does and inspect the error string to see whether it's because of a dead object, and null out the pointer if so?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants