Skip to content

Commit

Permalink
Re #8487. Don't leak memory due to Poco calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Mar 6, 2014
1 parent b3d6ff8 commit 3298f78
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -9,8 +9,9 @@
#include <Poco/DOM/NodeIterator.h>
#include <Poco/DOM/NodeFilter.h>
#include <Poco/DOM/NamedNodeMap.h>
#include <Poco/AutoPtr.h>

#include<algorithm>
#include <algorithm>

namespace Mantid
{
Expand Down Expand Up @@ -58,7 +59,7 @@ namespace Mantid
typedef std::vector<Mantid::Geometry::IMDDimension_sptr>::iterator Iterator;

Poco::XML::DOMParser pParser;
Poco::XML::Document* pDoc = pParser.parseString(m_xmlToProcess);
Poco::AutoPtr<Poco::XML::Document> pDoc = pParser.parseString(m_xmlToProcess);
Poco::XML::Element* pRootElem = pDoc->documentElement();
//Apply root node checking if supplied.
Poco::XML::Element* geometryXMLElement = NULL;
Expand All @@ -79,7 +80,7 @@ namespace Mantid
}


Poco::XML::NodeList* dimensionsXML = geometryXMLElement-> getElementsByTagName(MDGeometryXMLDefinitions::workspaceDimensionElementName());
Poco::AutoPtr<Poco::XML::NodeList> dimensionsXML = geometryXMLElement-> getElementsByTagName(MDGeometryXMLDefinitions::workspaceDimensionElementName());
size_t nDimensions = dimensionsXML->length();
VecIMDDimension_sptr vecAllDims(nDimensions);

Expand Down

0 comments on commit 3298f78

Please sign in to comment.