[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim] [patch] KMail: avoid one warning and one crash
From:       Jarosław Staniek <js () iidea ! pl>
Date:       2008-05-20 10:21:41
Message-ID: 4832A635.8010109 () iidea ! pl
[Download RAW message or body]

Two changes for review:
1. KMailICalIfaceImpl::findMessageBySerNum(): avid warnings when serNum == 0: 
return immediately as we do not expect to have 0 serial nums.

2. KMAcctCachedImap::killAllJobsInternal(): check mSlave before accessing 
it.key() - this could avoid crash when KJob is already dead.

-- 
regards / pozdrawiam, Jaroslaw Staniek
  Sponsored by OpenOffice Polska (http://www.openoffice.com.pl/en) to work on
  Kexi & KOffice (http://www.kexi.pl/en, http://www.koffice.org/kexi)
  KDE Libraries for MS Windows (http://windows.kde.org)

["kmail.patch" (text/plain)]

Index: kmailicalifaceimpl.cpp
===================================================================
--- kmailicalifaceimpl.cpp	(wersja 809621)
+++ kmailicalifaceimpl.cpp	(kopia robocza)
@@ -1296,7 +1296,7 @@
 // Find message matching a given serial number
 KMMessage *KMailICalIfaceImpl::findMessageBySerNum( quint32 serNum, KMFolder* folder )
 {
-  if( !folder ) return 0;
+  if( !folder || serNum == 0 ) return 0;
 
   KMMessage *message = 0;
   KMFolder* aFolder = 0;
Index: kmacctcachedimap.cpp
===================================================================
--- kmacctcachedimap.cpp	(wersja 809621)
+++ kmacctcachedimap.cpp	(kopia robocza)
@@ -127,7 +127,7 @@
     if ((*it).parent)
       folderList << static_cast<KMFolderCachedImap*>((*it).parent->storage());
     // Kill the job - except if it's the one that already died and is calling us
-    if ( !it.key()->error() && mSlave ) {
+    if ( mSlave && !it.key()->error() ) {
       it.key()->kill();
       mSlave = 0; // killing a job, kills the slave
     }


_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic