From 9960461b9b88a875476c2fa8bf916699e4ecc7fa Mon Sep 17 00:00:00 2001 From: "bienvenu%nventure.com" Date: Tue, 30 Sep 2003 15:36:15 +0000 Subject: [PATCH] fix crash cancelling msg copy operation, r=neil.parkwaycc.co.uk, sr=sspitzer git-svn-id: svn://10.0.0.236/trunk@147457 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/base/src/nsMsgCopyService.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/mozilla/mailnews/base/src/nsMsgCopyService.cpp b/mozilla/mailnews/base/src/nsMsgCopyService.cpp index ab9b25e3e58..af9057c2ae8 100644 --- a/mozilla/mailnews/base/src/nsMsgCopyService.cpp +++ b/mozilla/mailnews/base/src/nsMsgCopyService.cpp @@ -287,11 +287,17 @@ nsMsgCopyService::DoNextCopy() } else if (copyRequest->m_requestType == nsCopyFoldersType ) { - copySource->m_processed = PR_TRUE; + copySource->m_processed = PR_TRUE; rv = copyRequest->m_dstFolder->CopyFolder (copySource->m_msgFolder, copyRequest->m_isMoveOrDraftOrTemplate, copyRequest->m_msgWindow, copyRequest->m_listener); + // If it's a copy folder operation and the destination + // folder already exists, CopyFolder() returns an error w/o sending + // a completion notification, so clear it here. + if (NS_FAILED(rv)) + ClearRequest(copyRequest, rv); + } else if (copyRequest->m_requestType == nsCopyFileMessageType) { @@ -318,14 +324,6 @@ nsMsgCopyService::DoNextCopy() } } } - // Don't clear copy request in failure case - notify completion should do that. - // Hmm, this is not true in case it's a copy folder opeation and the destination - // folder already exists. In this case CopyFolder() returns an error and there - // won't be completion notification at all and the request will stay in the - // queue forever. - if (NS_FAILED(rv)) - ClearRequest(copyRequest, rv); - return rv; }