Open spectranaut opened 6 months ago
Notes:
getRoleName() == invalid
(process:1140712): GLib-CRITICAL **: 12:09:21.592: g_hash_table_iter_init: assertion 'hash_table != NULL' failed Segmentation fault
Probably this won't happen frequently in testing, but it's still worth thinking about a little bit more.
I think maybe we can do something like https://github.com/Igalia/acacia/pull/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?
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.