[Kde-pim] Kmail crashes

Ratko Rudič ratko at kramfid.org
Sat Jan 6 22:19:04 GMT 2007


Hi all.

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?


Greetings,
ratko
_______________________________________________
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