diff --git a/Code/Mantid/Framework/SINQ/src/SINQHMListener.cpp b/Code/Mantid/Framework/SINQ/src/SINQHMListener.cpp index 32bd7313f9b2ebdd1b47edf2204f0ecc563927d9..1ed6b59a3b1735b33c856707f277ed1b42c50a92 100644 --- a/Code/Mantid/Framework/SINQ/src/SINQHMListener.cpp +++ b/Code/Mantid/Framework/SINQ/src/SINQHMListener.cpp @@ -7,17 +7,16 @@ #include "MantidSINQ/SINQHMListener.h" #include "MantidAPI/LiveListenerFactory.h" #include "MantidMDEvents/MDHistoWorkspace.h" + #include <Poco/Net/HTTPRequest.h> -#include <Poco/Net/HTTPResponse.h> #include <Poco/Net/HTTPBasicCredentials.h> #include <Poco/StreamCopier.h> -#include <iostream> -#include <sstream> #include <Poco/DOM/DOMParser.h> #include <Poco/DOM/Document.h> -#include <Poco/DOM/Element.h> #include <Poco/DOM/NodeList.h> -#include <Poco/DOM/Text.h> +#include <Poco/AutoPtr.h> +#include <iostream> +#include <sstream> using namespace Mantid::API; using namespace Mantid::Geometry; @@ -31,6 +30,7 @@ DECLARE_LISTENER(SINQHMListener) SINQHMListener::SINQHMListener() : ILiveListener(), httpcon(), response() { connected = false; dimDirty = true; + rank = 0; } SINQHMListener::~SINQHMListener() {} @@ -131,14 +131,14 @@ void SINQHMListener::loadDimensions() { Poco::StreamCopier::copyStream(istr, oss); DOMParser xmlParser; - Document *doc; + Poco::AutoPtr<Document> doc; try { doc = xmlParser.parseString(oss.str()); } catch (...) { throw std::runtime_error("Unable to parse sinqhm.xml"); } Element *root = doc->documentElement(); - NodeList *bankList = root->getElementsByTagName("bank"); + Poco::AutoPtr<NodeList> bankList = root->getElementsByTagName("bank"); /** * TODO: There may be multiple banks but I only * look at the first @@ -147,7 +147,7 @@ void SINQHMListener::loadDimensions() { std::string rankt = bank->getAttribute("rank"); rank = atoi(rankt.c_str()); - NodeList *axisList = bank->getElementsByTagName("axis"); + Poco::AutoPtr<NodeList> axisList = bank->getElementsByTagName("axis"); for (unsigned int i = 0; i < axisList->length(); i++) { Element *axis = dynamic_cast<Element *>(axisList->item(i)); std::string sdim = axis->getAttribute("length");