Bug 1000613 - Don't leak txExecutionState::mInitialEvalContext. r=peterv
authorAndrew McCreight <continuation@gmail.com>
Thu, 15 May 2014 09:33:00 +0200
changeset 184074 90b98c0ef8153726f6ece0a4c056ba2e94987034
parent 184073 c30bd0018acb7c92ac951cf6623749bff560c6be
child 184075 6b57eca751f8ea2b5bb1162c99ec2085e4816c14
push id26810
push usercbook@mozilla.com
push dateWed, 21 May 2014 11:46:36 +0000
treeherdermozilla-central@50fb8c4db2fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1000613
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1000613 - Don't leak txExecutionState::mInitialEvalContext. r=peterv
dom/xslt/xslt/txExecutionState.cpp
--- a/dom/xslt/xslt/txExecutionState.cpp
+++ b/dom/xslt/xslt/txExecutionState.cpp
@@ -58,17 +58,19 @@ txExecutionState::txExecutionState(txSty
 }
 
 txExecutionState::~txExecutionState()
 {
     MOZ_COUNT_DTOR(txExecutionState);
 
     delete mResultHandler;
     delete mLocalVariables;
-    delete mEvalContext;
+    if (mEvalContext != mInitialEvalContext) {
+        delete mEvalContext;
+    }
     
     txStackIterator varsIter(&mLocalVarsStack);
     while (varsIter.hasNext()) {
         delete (txVariableMap*)varsIter.next();
     }
 
     txStackIterator contextIter(&mEvalContextStack);
     while (contextIter.hasNext()) {
@@ -82,16 +84,18 @@ txExecutionState::~txExecutionState()
     while (handlerIter.hasNext()) {
         delete (txAXMLEventHandler*)handlerIter.next();
     }
 
     txStackIterator paramIter(&mParamStack);
     while (paramIter.hasNext()) {
         delete (txVariableMap*)paramIter.next();
     }
+
+    delete mInitialEvalContext;
 }
 
 nsresult
 txExecutionState::init(const txXPathNode& aNode,
                        txOwningExpandedNameMap<txIGlobalParameter>* aGlobalParams)
 {
     nsresult rv = NS_OK;