fix crash drag dropping virtual folders, 264605, clean up virtural folder db listening code

git-svn-id: svn://10.0.0.236/branches/AVIARY_1_0_20040515_BRANCH@164723 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bienvenu%nventure.com
2004-11-01 06:19:31 +00:00
parent d4abc29245
commit e9851860ab

View File

@@ -2644,11 +2644,10 @@ NS_IMETHODIMP VirtualFolderChangeListener::OnParentChanged(nsMsgKey aKeyChanged,
NS_IMETHODIMP VirtualFolderChangeListener::OnAnnouncerGoingAway(nsIDBChangeAnnouncer *instigator)
{
nsresult rv;
nsCOMPtr<nsIMsgDBService> msgDBService = do_GetService(NS_MSGDB_SERVICE_CONTRACTID, &rv);
if (msgDBService)
msgDBService->UnregisterPendingListener(this);
return rv;
nsCOMPtr <nsIMsgDatabase> msgDB = do_QueryInterface(instigator);
if (msgDB)
msgDB->RemoveListener(this);
return NS_OK;
}
NS_IMETHODIMP VirtualFolderChangeListener::OnReadChanged(nsIDBChangeListener *aInstigator)
@@ -2833,6 +2832,8 @@ NS_IMETHODIMP nsMsgAccountManager::SaveVirtualFolders()
nsCOMPtr <nsIMsgDatabase> db;
nsCOMPtr <nsIDBFolderInfo> dbFolderInfo;
rv = msgFolder->GetDBFolderInfoAndDB(getter_AddRefs(dbFolderInfo), getter_AddRefs(db)); // force db to get created.
if (dbFolderInfo)
{
nsXPIDLCString srchFolderUri;
nsXPIDLCString searchTerms;
PRBool searchOnline = PR_FALSE;
@@ -2848,6 +2849,7 @@ NS_IMETHODIMP nsMsgAccountManager::SaveVirtualFolders()
}
}
}
}
if (outputStream)
outputStream->Close();
}