diff -r 4e54af54a4a1 -r 6c59112cfd31 emailservices/emailclientapi/src/emailmessagesearch.cpp --- a/emailservices/emailclientapi/src/emailmessagesearch.cpp Wed Sep 15 17:47:19 2010 +0300 +++ b/emailservices/emailclientapi/src/emailmessagesearch.cpp Thu Sep 30 11:43:07 2010 +0300 @@ -91,7 +91,7 @@ { if (KErrNone != iGate.Wait(1)) { - this->Cancel(); + this->CancelSearch(); } delete this; } @@ -256,21 +256,12 @@ void CEmailMessageSearchAsync::Cancel() { if (KErrNone != iGate.Wait(1)) - { - - /** - * Cancels current search. Does nothing if there is not any search. - * The search client will not be called back after this function is called. - * - */ - const TFSMailMsgId fsMailboxId( iPluginData.Uid(), iMailboxId.iId ); - iPlugin->CancelSearch( fsMailboxId ); + { + CancelSearch(); } - else - { - // Release gate - iGate.Signal(); - } + + // Release gate + iGate.Signal(); } // ----------------------------------------------------------------------------- @@ -295,7 +286,9 @@ // Release gate iGate.Signal(); } - + //if we really locked iGate here, we release it in else + //brach. If it was already locked, we must not release it here! + // coverity[missing_unlock] return ret; } @@ -306,7 +299,7 @@ { if ( KErrNone != iGate.Wait( 1 ) ) { - this->Cancel(); + this->CancelSearch(); } iCriteria = TFSMailSortCriteria(); @@ -360,4 +353,17 @@ } } +// ----------------------------------------------------------------------------- +// Cancels search +// ----------------------------------------------------------------------------- +void CEmailMessageSearchAsync::CancelSearch() + { + /** + * Cancels current search. Does nothing if there is not any search. + * The search client will not be called back after this function is called. + * + */ + const TFSMailMsgId fsMailboxId( iPluginData.Uid(), iMailboxId.iId ); + iPlugin->CancelSearch( fsMailboxId ); + } // End of file