зеркало из https://github.com/mozilla/pjs.git
Fixed ref counting problems related to deleting a message. Reviewed by bienvenu and
approved by chofmann
This commit is contained in:
Родитель
b446581eeb
Коммит
5d1ffa22cf
|
@ -20,6 +20,11 @@
|
|||
#include "plstr.h"
|
||||
#include "nsString.h"
|
||||
|
||||
nsLocalFolderSummarySpec::~nsLocalFolderSummarySpec()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
nsLocalFolderSummarySpec::nsLocalFolderSummarySpec()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
class nsLocalFolderSummarySpec : public nsFileSpec
|
||||
{
|
||||
public:
|
||||
virtual ~nsLocalFolderSummarySpec();
|
||||
nsLocalFolderSummarySpec();
|
||||
nsLocalFolderSummarySpec(const char *folderPath, PRBool create = PR_FALSE);
|
||||
nsLocalFolderSummarySpec(const nsFileSpec& inFolderPath);
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "nsString.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
||||
nsresult GetMessageServiceProgIDForURI(const char *uri, nsString &progID)
|
||||
{
|
||||
|
@ -110,20 +111,27 @@ NS_IMETHODIMP nsMessageFromMsgHdrEnumerator::Next(void)
|
|||
|
||||
NS_IMETHODIMP nsMessageFromMsgHdrEnumerator::CurrentItem(nsISupports **aItem)
|
||||
{
|
||||
nsISupports *currentItem = nsnull;
|
||||
nsIMsgDBHdr *msgDBHdr = nsnull;
|
||||
nsIMessage *message = nsnull;
|
||||
nsCOMPtr<nsISupports> currentItem;
|
||||
nsCOMPtr<nsIMsgDBHdr> msgDBHdr;
|
||||
nsCOMPtr<nsIMessage> message;
|
||||
nsresult rv;
|
||||
|
||||
rv = mSrcEnumerator->CurrentItem(¤tItem);
|
||||
rv = mSrcEnumerator->CurrentItem(getter_AddRefs(currentItem));
|
||||
if(NS_SUCCEEDED(rv))
|
||||
rv = currentItem->QueryInterface(nsIMsgDBHdr::GetIID(), (void**)&msgDBHdr);
|
||||
{
|
||||
msgDBHdr = do_QueryInterface(currentItem, &rv);
|
||||
}
|
||||
|
||||
if(NS_SUCCEEDED(rv))
|
||||
rv = mFolder->CreateMessageFromMsgDBHdr(msgDBHdr, &message);
|
||||
{
|
||||
rv = mFolder->CreateMessageFromMsgDBHdr(msgDBHdr, getter_AddRefs(message));
|
||||
}
|
||||
|
||||
if(NS_SUCCEEDED(rv))
|
||||
{
|
||||
*aItem = message;
|
||||
NS_ADDREF(*aItem);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче