fix leak of imap folders when getting imap new mail r=naving, sr=sspitzer 102146

This commit is contained in:
bienvenu%netscape.com 2001-09-28 23:00:31 +00:00
Родитель 856a576117
Коммит dc4d910593
2 изменённых файлов: 12 добавлений и 16 удалений

Просмотреть файл

@ -45,18 +45,14 @@
static NS_DEFINE_CID(kCImapService, NS_IMAPSERVICE_CID);
nsImapMoveCoalescer::nsImapMoveCoalescer(nsImapMailFolder *sourceFolder, nsIMsgWindow *msgWindow)
nsImapMoveCoalescer::nsImapMoveCoalescer(nsIMsgFolder *sourceFolder, nsIMsgWindow *msgWindow)
{
m_sourceFolder = sourceFolder;
m_sourceFolder = sourceFolder;
m_msgWindow = msgWindow;
NS_IF_ADDREF(msgWindow);
if (sourceFolder)
NS_ADDREF(sourceFolder);
}
nsImapMoveCoalescer::~nsImapMoveCoalescer()
{
NS_IF_RELEASE(m_sourceFolder);
for (PRInt32 i = 0; i < m_sourceKeyArrays.Count(); i++)
{
nsMsgKeyArray *keys = (nsMsgKeyArray *) m_sourceKeyArrays.ElementAt(i);
@ -122,13 +118,13 @@ nsresult nsImapMoveCoalescer::PlaybackMoves(nsIEventQueue *eventQueue)
{
nsCString messageIds;
m_sourceFolder->AllocateUidStringFromKeys(keysToAdd->GetArray(), keysToAdd->GetSize(), messageIds);
nsImapMailFolder::AllocateUidStringFromKeys(keysToAdd->GetArray(), keysToAdd->GetSize(), messageIds);
destFolder->SetNumNewMessages(keysToAdd->GetSize());
//destFolder->SetBiffState(nsIMsgFolder::nsMsgBiffState_NewMail);
destFolder->SetHasNewMessages(PR_TRUE);
nsCOMPtr <nsISupports> sourceSupports = do_QueryInterface((nsIMsgImapMailFolder *) m_sourceFolder, &rv);
nsCOMPtr <nsISupports> sourceSupports = do_QueryInterface(m_sourceFolder, &rv);
nsCOMPtr <nsIUrlListener> urlListener(do_QueryInterface(sourceSupports));
nsCOMPtr<nsISupportsArray> messages;

Просмотреть файл

@ -55,17 +55,17 @@ class nsImapMailFolder;
class nsImapMoveCoalescer
{
public:
nsImapMoveCoalescer(nsImapMailFolder *sourceFolder, nsIMsgWindow *msgWindow);
virtual ~nsImapMoveCoalescer();
nsImapMoveCoalescer(nsIMsgFolder *sourceFolder, nsIMsgWindow *msgWindow);
virtual ~nsImapMoveCoalescer();
nsresult AddMove(nsIMsgFolder *folder, nsMsgKey key);
nsresult PlaybackMoves(nsIEventQueue *eventQueue);
nsresult AddMove(nsIMsgFolder *folder, nsMsgKey key);
nsresult PlaybackMoves(nsIEventQueue *eventQueue);
protected:
// m_sourceKeySets and m_destFolders are parallel arrays.
nsVoidArray m_sourceKeyArrays;
nsCOMPtr <nsISupportsArray> m_destFolders;
// m_sourceKeySets and m_destFolders are parallel arrays.
nsVoidArray m_sourceKeyArrays;
nsCOMPtr <nsISupportsArray> m_destFolders;
nsCOMPtr <nsIMsgWindow> m_msgWindow;
nsImapMailFolder *m_sourceFolder;
nsCOMPtr <nsIMsgFolder> m_sourceFolder;
};
#endif // _nsImapMoveCoalescer_H