Skip to content

Commit

Permalink
Re #8167. Fix a memory leak.
Browse files Browse the repository at this point in the history
Make sure the resources allocated by the Poco XML parsing are released.
This is achieved by making sure release() is called on the object returned
by getElementsByTagName(). Poco::AutoPtr does this on its destruction.
  • Loading branch information
RussellTaylor committed Oct 21, 2013
1 parent 23a26ab commit 1e1cf4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Code/Mantid/Framework/Kernel/src/RemoteJobManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <Poco/Net/NameValueCollection.h>
#include <Poco/URI.h>

#include <Poco/AutoPtr.h>
#include <Poco/DOM/Element.h>
#include <Poco/DOM/NodeList.h>
#include <Poco/DOM/Text.h>
Expand All @@ -36,7 +37,7 @@ RemoteJobManager::RemoteJobManager( const Poco::XML::Element* elem)
throw std::runtime_error("Compute Resources must have a name attribute");
}

Poco::XML::NodeList* nl = elem->getElementsByTagName("baseURL");
Poco::AutoPtr<Poco::XML::NodeList> nl = elem->getElementsByTagName("baseURL");
if (nl->length() != 1)
{
g_log.error("HTTP Compute Resources must have exactly one baseURL tag");
Expand Down

0 comments on commit 1e1cf4f

Please sign in to comment.