diff --git a/mozilla/mailnews/base/search/src/nsMsgLocalSearch.cpp b/mozilla/mailnews/base/search/src/nsMsgLocalSearch.cpp index 41d95130ea5..895ba81d3a8 100644 --- a/mozilla/mailnews/base/search/src/nsMsgLocalSearch.cpp +++ b/mozilla/mailnews/base/search/src/nsMsgLocalSearch.cpp @@ -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; diff --git a/mozilla/mailnews/base/search/src/nsMsgSearchSession.cpp b/mozilla/mailnews/base/search/src/nsMsgSearchSession.cpp index 0aa62cf11f4..f4d2bdd3f8f 100644 --- a/mozilla/mailnews/base/search/src/nsMsgSearchSession.cpp +++ b/mozilla/mailnews/base/search/src/nsMsgSearchSession.cpp @@ -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(); }