fix memory leaks and mismatched deletes

This commit is contained in:
bienvenu%netscape.com 1999-09-18 18:40:16 +00:00
Родитель eba8d9c336
Коммит f82367de5f
2 изменённых файлов: 6 добавлений и 4 удалений

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

@ -30,7 +30,8 @@ nsMsgFolderCacheElement::nsMsgFolderCacheElement()
nsMsgFolderCacheElement::~nsMsgFolderCacheElement()
{
NS_IF_RELEASE(m_mdbRow);
NS_IF_RELEASE(m_owningCache);
// circular reference, don't do it.
// NS_IF_RELEASE(m_owningCache);
PR_FREEIF(m_folderURI);
}
@ -43,8 +44,9 @@ NS_IMPL_SETTER_STR(nsMsgFolderCacheElement::SetURI, m_folderURI)
void nsMsgFolderCacheElement::SetOwningCache(nsMsgFolderCache *owningCache)
{
m_owningCache = owningCache;
if (owningCache)
NS_ADDREF(owningCache);
// circular reference, don't do it.
// if (owningCache)
// NS_ADDREF(owningCache);
}
NS_IMETHODIMP nsMsgFolderCacheElement::GetStringProperty(const char *propertyName, char **result)

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

@ -258,7 +258,7 @@ nsresult nsMsgNotificationManager::AddNewMailNotification(nsIMsgFolder *folder)
if(NS_SUCCEEDED(rv) && folderDescription)
{
sourceString = folderDescription;
delete[] folderDescription;
nsAllocator::Free(folderDescription);
}
rv = rdfService->GetLiteral(sourceString.GetUnicode(), getter_AddRefs(source));
if(NS_SUCCEEDED(rv))