aboutsummaryrefslogtreecommitdiff
path: root/src/support/dom/document_cache.cc
diff options
context:
space:
mode:
authorAdrian Kummerlaender2020-04-25 20:42:08 +0200
committerAdrian Kummerlaender2020-04-25 20:42:08 +0200
commit6d353960542e5c95f29d45b9359db25945a414a4 (patch)
treecfdc4fdc02a3bf89c73708380d71774b9445ae8a /src/support/dom/document_cache.cc
parentd4f3c3d2f61616e09d01cc927ba0dbdc393d25a0 (diff)
downloadInputXSLT-6d353960542e5c95f29d45b9359db25945a414a4.tar
InputXSLT-6d353960542e5c95f29d45b9359db25945a414a4.tar.gz
InputXSLT-6d353960542e5c95f29d45b9359db25945a414a4.tar.bz2
InputXSLT-6d353960542e5c95f29d45b9359db25945a414a4.tar.lz
InputXSLT-6d353960542e5c95f29d45b9359db25945a414a4.tar.xz
InputXSLT-6d353960542e5c95f29d45b9359db25945a414a4.tar.zst
InputXSLT-6d353960542e5c95f29d45b9359db25945a414a4.zip
Fix std::unique_ptr custom deleter issue
Somehow the previous custom deleter for xercesc::DOMDocument fails invokable assertions planet a compiler update. A lambda function with the same signature wors for some reason…
Diffstat (limited to 'src/support/dom/document_cache.cc')
-rw-r--r--src/support/dom/document_cache.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/support/dom/document_cache.cc b/src/support/dom/document_cache.cc
index c000aef..0133234 100644
--- a/src/support/dom/document_cache.cc
+++ b/src/support/dom/document_cache.cc
@@ -11,7 +11,10 @@ namespace InputXSLT {
auto DomDocumentCache::createDocument() -> document_ptr {
return document_ptr(
- xercesc::DOMImplementation::getImplementation()->createDocument()
+ xercesc::DOMImplementation::getImplementation()->createDocument(),
+ [](xercesc::DOMDocument* ptr) {
+ ptr->release();
+ }
);
}
@@ -21,7 +24,10 @@ auto DomDocumentCache::createDocument(const std::string& name) -> document_ptr {
nullptr,
*XercesStringGuard<XMLCh>(name),
nullptr
- )
+ ),
+ [](xercesc::DOMDocument* ptr) {
+ ptr->release();
+ }
);
}
@@ -41,9 +47,4 @@ xalan::XalanDocument* DomDocumentCache::create(document_ptr&& document) {
return this->cache_.top()->getXalanDocument();
}
-void DomDocumentCache::document_deleter::operator()(
- xercesc::DOMDocument* document) {
- document->release();
-}
-
}