From 30c12f27bc55811838776390417fbcd2551b7632 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 9 May 2016 01:12:34 +0100 Subject: Fix leak of html/xml document structure --- project2/xml/xmlDocumentCache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project2/xml/xmlDocumentCache.cpp b/project2/xml/xmlDocumentCache.cpp index 94157ec..f981a24 100644 --- a/project2/xml/xmlDocumentCache.cpp +++ b/project2/xml/xmlDocumentCache.cpp @@ -24,8 +24,8 @@ static XmlDocumentCache::DocumentPtr helperThrow(const std::string & msg) { static XmlDocumentCache::DocumentPtr helperReturnDom(XmlDocumentCache::DomParserPtr dp) { return dp->get_document(); } -static XmlDocumentCache::DocumentPtr helperReturnDocument(XmlDocumentCache::DocumentPtr dp) { - return dp; +static XmlDocumentCache::DocumentPtr helperReturnDocument(boost::shared_ptr dp) { + return dp.get(); } XmlDocumentCache::XmlDocumentCache(ScriptNodePtr n) : @@ -87,7 +87,7 @@ XmlDocumentCache::queue(const Glib::ustring & url, boost::optional // end hack XmlDocumentCache::documents.insert(XmlDocumentCache::Documents::value_type(url, - boost::bind(helperReturnDocument, XmlDocumentCache::DocumentPtr(new xmlpp::Document(doc))))); + boost::bind(helperReturnDocument, boost::shared_ptr(new xmlpp::Document(doc))))); } else { try { -- cgit v1.2.3