[Kde-pim] KMail crashes when message box is shown on startup

Ingo Klöcker kloecker at kde.org
Sun Jun 10 22:41:38 BST 2007


On Saturday 09 June 2007 23:00, Thomas McGuire wrote:
> Hello,
>
> KMail currently crashes when any messagebox is shown at startup,
> before the kernel is fully initialized.
>
> One example is the messagebox from transportmanager, which asks to
> migrate all passwords to KWallet.
> This messagebox is shown when the kernel is initializing, which is
> before the main event loop is entered.
>
> The problem is that KMessageBox calls the main event loop.
> There we get an event which tells us to create the application
> instance, therefore KMailApplication::newInstance() is called. This
> function creates a mainwindow and does other initializations, which
> won't work (crash) because the kernel is not yet fully initialized.
>
> Attached is hacky patch which solves the problem. However, I guess
> this is not the proper method and breaks some things, probably some
> KUniqueApplication logic.
>
> I guess in Qt3 the messageboxes didn't call the event loop, which is
> why it doesn't crash there.
>
> Any ideas how to solve this properly?

After a quick look at kmkernel.cpp I suggest to delay the instantiation 
of MailTransport::TransportManager by moving the connects from 
KMKernel's c'tor to the init() method. See the attached (and completely 
untested) patch.

Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: delay-transportmanager-init.diff
Type: text/x-diff
Size: 1321 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20070610/77c5c3a2/attachment.diff>
-------------- 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-pim/attachments/20070610/77c5c3a2/attachment.sig>
-------------- next part --------------
_______________________________________________
kde-pim mailing list
kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/


More information about the kde-pim mailing list