[PATCH] Fix for bug 147036 (KGlobalAccel dtor crashes during app shutdown)

Andreas Hartmetz ahartmetz at gmail.com
Sun Jun 24 13:35:19 BST 2007


On Sunday 24 June 2007 07:35:17 Michael Pyne wrote:
> Hi all,
>
> Could someone review the following patch for bug 147036
> (http://bugs.kde.org/show_bug.cgi?id=147036) ?
>
> Basically the problem is that during application shutdown, the static
> deleter for KGlobalAccel fires and starts the shutdown process.  Which is
> good, but that involves releasing the grab it has on various keys, which
> (in kkeyserver_x11.cpp) ends up calling QX11Info::display().
>
> But by this point the Display handle has been closed (so ::display()
> returns 0), so libX11 crashes.  Even if you cache the value, it's not
> longer valid so libX11 still crashes.
>
> The fix is either to force deletion before the GUI is unloaded or to not
> ungrab keys for the static deleter shutdown.  I think this can be a general
> difficulty so I went for adding a method to KApplication to allow
> programs/libraries to add a callback function to be called just before
> KApplication gets destroyed.  I don't want to just commit to KApplication
> though so if anyone has got comments/suggestions please feel free. :)
>
> This fix does work for the crash induced by JuK, I don't have time to test
> kicker but I can't see why it wouldn't have fixed that one as well.
>
Please don't spend too much time on the current KGlobalAccel. I am working on 
a replacement that does most things in a KDED module (which fixes some issues 
that were hard to fix otherwise) and that is somewhat more simple. There 
should be no API changes and it looks like it's going to be finished some 
time next week. I hope. Really. :)
The current version contains quite some TODO items due to things that are just 
not implemented. I didn't want to spend any additional time on it because 
it's the old general design.

> Regards,
>  - Michael Pyne
>




More information about the kde-core-devel mailing list