зеркало из https://github.com/mozilla/pjs.git
fix some memory leaks
This commit is contained in:
Родитель
a9ef6f67df
Коммит
c3039eb293
|
@ -197,7 +197,7 @@ nsresult nsDBFolderInfo::InitFromExistingDB()
|
|||
if (ret == NS_OK)
|
||||
{
|
||||
ret = rowCursor->NextRow(m_mdb->GetEnv(), &m_mdbRow, &rowPos);
|
||||
rowCursor->Release();
|
||||
rowCursor->CutStrongRef(m_mdb->GetEnv());
|
||||
if (ret == NS_OK && m_mdbRow)
|
||||
{
|
||||
LoadMemberVariables();
|
||||
|
|
|
@ -336,6 +336,12 @@ nsMsgDatabase::~nsMsgDatabase()
|
|||
NS_RELEASE(m_HeaderParser);
|
||||
m_HeaderParser = nsnull;
|
||||
}
|
||||
if (m_mdbAllMsgHeadersTable)
|
||||
m_mdbAllMsgHeadersTable->Release();
|
||||
|
||||
if (m_mdbAllThreadsTable)
|
||||
m_mdbAllThreadsTable->Release();
|
||||
|
||||
if (m_mdbEnv)
|
||||
{
|
||||
m_mdbEnv->CutStrongRef(m_mdbEnv); //??? is this right?
|
||||
|
@ -1574,6 +1580,8 @@ nsMsgDBEnumerator::nsMsgDBEnumerator(nsMsgDatabase* db,
|
|||
|
||||
nsMsgDBEnumerator::~nsMsgDBEnumerator()
|
||||
{
|
||||
if (mRowCursor)
|
||||
mRowCursor->CutStrongRef(mDB->GetEnv());
|
||||
NS_RELEASE(mDB);
|
||||
NS_IF_RELEASE(mResultHdr);
|
||||
}
|
||||
|
@ -1702,6 +1710,7 @@ NS_IMETHODIMP nsMsgDatabase::ListAllKeys(nsMsgKeyArray &outputKeys)
|
|||
if (err == NS_OK)
|
||||
outputKeys.Add(outOid.mOid_Id);
|
||||
}
|
||||
rowCursor->Release();
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
|
|
@ -748,8 +748,12 @@ nsresult nsMsgThread::ChangeChildCount(PRInt32 delta)
|
|||
nsresult ret = NS_OK;
|
||||
PRUint32 childCount = 0;
|
||||
m_mdbDB->RowCellColumnToUInt32(m_metaRow, m_mdbDB->m_threadChildrenColumnToken, childCount);
|
||||
|
||||
NS_ASSERTION(childCount != 0 || delta > 0, "child count gone negative");
|
||||
childCount += delta;
|
||||
|
||||
NS_ASSERTION((PRInt32) childCount >= 0, "child count gone to 0 or below");
|
||||
|
||||
ret = m_mdbDB->UInt32ToRowCellColumn(m_metaRow, m_mdbDB->m_threadChildrenColumnToken, childCount);
|
||||
return ret;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче