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

Matthias Kretz kretz at kde.org
Sun Jun 24 11:10:40 BST 2007


Hi,

On Sunday 24 June 2007, Michael Pyne wrote:
> Could someone review the following patch for bug 147036
> (http://bugs.kde.org/show_bug.cgi?id=147036) ?

It's not necessary to add anything to KApplication. QApplication does all we 
need already.

Last time I showed my patch on #kde4-devel Thiago and I kept going in circles 
about why we need a post routine, remove the post routine when called from 
lib unload and whether a K_GLOBAL_STATIC is necessary there at all. Short 
explanation why I think it we should do all that:
1. kdeui is unloaded before ~QApplication is called (this won't happen using 
KLibLoader, but QLibrary::unload() really calls dlclose)
   => global static is deleted using the K_GLOBAL_STATIC mechanism: then the 
post routine has to be removed, otherwise the app will keep a dangling 
function pointer and call it from ~QApplication
2. normal application shutdown: the post routine is called from ~QApplication 
and the K_GLOBAL_STATIC cleanup will call "delete 0"

Anyway here's my patch again (it also cleans up KGlobalAccel a bit):

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdeui-shortcuts.patch
Type: text/x-diff
Size: 7045 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070624/4e71bed6/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070624/4e71bed6/attachment.sig>


More information about the kde-core-devel mailing list