[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: [PATCH] Fix for bug 147036 (KGlobalAccel dtor crashes during app
From: Michael Pyne <michael.pyne () kdemail ! net>
Date: 2007-06-24 14:49:06
Message-ID: 200706241049.09790.michael.pyne () kdemail ! net
[Download RAW message or body]
On Sunday 24 June 2007, Matthias Kretz wrote:
> 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.
I noticed qAddPostRoutine but I thought it was not called until the
QCoreApplication constructor. Diving into the code reveals I was wrong. :)
> 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"
I will also note that the Qt docs are pretty clear that you should call the
qRemovePostRoutine in the destroy function you passed to qAddPostRoutine,
like you do. I think your patch manages to exceed my own.
Regards,
- Michael Pyne
["signature.asc" (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic