[g-a-devel]Gail Crashes

Hi All,

There are some crashes in Gail related to a bug I introduced that have become more frequent with the introduction of the idle handler for focusing menu items. So, there are two problems I see:

1. We cache the object which had the focus before the menubar got it so we can fake a focus event to it after the menu bar is deactivated. And, if that object happens to be gone, as a result of clicking the "exit application" menu item for example, we understandably blow up all the way through the stack.

2. In some cases we're setting an idle handler to send an ATK focus event when called. But, this isn't guaranteed to work either, since the item may have been destroyed before the idle handler is called. A possible solution seems to be:

In the notify_focus_when_idle function, we should install a signal handler for destroy signals on the widget which is to receive focus, passing in as the user_data a pointer to the widget pointer. If the destroy handler gets called, we NULL the widget pointer, and then in the idle handler, if the pointer is NULL, do nothing.

Is this guarantied to work? Are there cases where an application's main window is destroyed before the menubar is deactivated, in which case the destroy handler would never be installed and we would have the same problem of sending Atk focus events on behalf of GTK widgets which are gone?


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