fix crash on exit in nsMsgSearchSession destructor, 313357 sr=mscott

This commit is contained in:
bienvenu%nventure.com 2005-10-27 13:46:45 +00:00
parent b47111b006
commit 728735cdd4
2 changed files with 6 additions and 7 deletions

View File

@ -125,11 +125,9 @@ nsMsgSearchBoolExpression::nsMsgSearchBoolExpression (nsMsgSearchBoolExpression
nsMsgSearchBoolExpression::~nsMsgSearchBoolExpression()
{
// we must recursively destroy all sub expressions before we destroy ourself.....We leave search terms alone!
if (m_leftChild)
delete m_leftChild;
if (m_rightChild)
delete m_rightChild;
// we must recursively destroy all sub expressions before we destroy ourself.....We leave search terms alone!
delete m_leftChild;
delete m_rightChild;
}
nsMsgSearchBoolExpression *
@ -590,7 +588,7 @@ nsresult nsMsgSearchOfflineMail::MatchTerms(nsIMsgDBHdr *msgToMatch,
PRUint32 headerSize,
PRBool Filtering,
nsMsgSearchBoolExpression ** aExpressionTree,
PRBool *pResult)
PRBool *pResult)
{
NS_ENSURE_ARG(aExpressionTree);
nsresult err;

View File

@ -96,6 +96,7 @@ nsMsgSearchSession::AddSearchTerm(nsMsgSearchAttribValue attrib,
m_termList->AppendElement (pTerm);
// force the expression tree to rebuild whenever we change the terms
delete m_expressionTree;
m_expressionTree = nsnull;
return NS_OK;
}
@ -105,6 +106,7 @@ nsMsgSearchSession::AppendTerm(nsIMsgSearchTerm *aTerm)
NS_ENSURE_ARG_POINTER(aTerm);
NS_ENSURE_TRUE(m_termList, NS_ERROR_NOT_INITIALIZED);
delete m_expressionTree;
m_expressionTree = nsnull;
return m_termList->AppendElement(aTerm);
}
@ -648,7 +650,6 @@ void nsMsgSearchSession::DestroyScopeList()
void nsMsgSearchSession::DestroyTermList ()
{
delete m_expressionTree;
m_termList->Clear();
}