[Kde-pim] Kmail crashes

Till Adam till at kdab.net
Mon Jan 8 17:34:39 GMT 2007


On Saturday 06 January 2007 23:19, Ratko Rudič wrote:

> KMail crashes a lot to me. It always happens right after the:
> "WARNING: Trying to close the selected folder ..."
>
> so, I've been looking into it and found that in kmfolderimap.cpp maybe
> mOpenCount is decremented too soon. If folder is currently selected,
> mOpenCount would still decrement before the warning (folder is not really
> closed as it is in use).
>
> In "KMFolder::close()" code is like this:
>   if (mOpenCount <= 0 ) return;
>   if (mOpenCount > 0) mOpenCount--;
>   if (mOpenCount > 0 && !aForced) return;
>   if (isSelected() && !aForced) {
>       kdWarning(5006) << "Trying to close the selected folder " << label()
> << " - ignoring!" << endl;
>       return;
>   }
>
> I changed (moved) it to:
>   if (mOpenCount <= 0 ) return;
>   if (isSelected() && !aForced) {
>       kdWarning(5006) << "Trying to close the selected folder " << label()
> << " - ignoring!" << endl;
>       return;
>   }
>   if (mOpenCount > 0) mOpenCount--;
>   if (mOpenCount > 0 && !aForced) return;
>
> So now mOpenCount stays the same if we try to close a folder in use.
> KMail seems more stable (=hasn't crashed in a day) after this change.
>
> Does this change seems reasonable to anyone?

Yes, it's an improvement, although it would be even better to find out where 
the premature closing is coming from.

Thanks for helping out, in any case. :)

Till

-- 
Till Adam -- till at kdab.net, adam at kde.org
Klarälvdalens Datakonsult AB, Platform-independent software solutions
_______________________________________________
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