diff --git a/mailnews/base/src/nsMsgSearchDBView.cpp b/mailnews/base/src/nsMsgSearchDBView.cpp index a7612484d6d5..797bb7259bb2 100644 --- a/mailnews/base/src/nsMsgSearchDBView.cpp +++ b/mailnews/base/src/nsMsgSearchDBView.cpp @@ -83,6 +83,8 @@ NS_IMETHODIMP nsMsgSearchDBView::Close() for(PRInt32 i = 0; i < count; i++) m_dbToUseList[i]->RemoveListener(this); + m_dbToUseList.Clear(); + return NS_OK; } @@ -222,6 +224,12 @@ nsMsgSearchDBView::OnNewSearch() return NS_OK; } +NS_IMETHODIMP nsMsgSearchDBView::OnAnnouncerGoingAway(nsIDBChangeAnnouncer *instigator) +{ + m_dbToUseList.RemoveObject(NS_STATIC_CAST(nsIMsgDatabase *, instigator)); + return nsMsgDBView::OnAnnouncerGoingAway(instigator); +} + nsresult nsMsgSearchDBView::GetFolders(nsISupportsArray **aFolders) { NS_ENSURE_ARG_POINTER(aFolders); diff --git a/mailnews/base/src/nsMsgSearchDBView.h b/mailnews/base/src/nsMsgSearchDBView.h index c82820ba58d4..7154c10b25e4 100644 --- a/mailnews/base/src/nsMsgSearchDBView.h +++ b/mailnews/base/src/nsMsgSearchDBView.h @@ -67,6 +67,8 @@ public: virtual nsresult OnNewHeader(nsIMsgDBHdr *newHdr, nsMsgKey parentKey, PRBool ensureListed); NS_IMETHOD GetFolderForViewIndex(nsMsgViewIndex index, nsIMsgFolder **folder); + NS_IMETHOD OnAnnouncerGoingAway(nsIDBChangeAnnouncer *instigator); + virtual nsresult GetFolders(nsISupportsArray **aFolders); virtual nsresult GetFolderFromMsgURI(const char *aMsgURI, nsIMsgFolder **aFolder);