summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-05-09 01:12:34 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-05-09 01:12:34 +0100
commit30c12f27bc55811838776390417fbcd2551b7632 (patch)
tree7f54d40d7415c2d082a0f1717dfccfef7218da91
parentDon't require ModelPartFor compat wrapper (diff)
downloadproject2-30c12f27bc55811838776390417fbcd2551b7632.tar.bz2
project2-30c12f27bc55811838776390417fbcd2551b7632.tar.xz
project2-30c12f27bc55811838776390417fbcd2551b7632.zip
Fix leak of html/xml document structure
-rw-r--r--project2/xml/xmlDocumentCache.cpp6
1 files 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<xmlpp::Document> dp) {
+ return dp.get();
}
XmlDocumentCache::XmlDocumentCache(ScriptNodePtr n) :
@@ -87,7 +87,7 @@ XmlDocumentCache::queue(const Glib::ustring & url, boost::optional<std::string>
// 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<xmlpp::Document>(new xmlpp::Document(doc)))));
}
else {
try {