summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gentoobrowse-api/service/xsltStreamSerializer.cpp10
-rw-r--r--gentoobrowse-api/service/xsltStreamSerializer.h3
2 files changed, 3 insertions, 10 deletions
diff --git a/gentoobrowse-api/service/xsltStreamSerializer.cpp b/gentoobrowse-api/service/xsltStreamSerializer.cpp
index cebae7b..acb5750 100644
--- a/gentoobrowse-api/service/xsltStreamSerializer.cpp
+++ b/gentoobrowse-api/service/xsltStreamSerializer.cpp
@@ -36,20 +36,16 @@ namespace Gentoo {
}
XsltStreamSerializer::XsltStreamSerializer(IceTray::Mail::EmailPtr e, xsltStylesheet * ss) :
- Slicer::XmlDocumentSerializer(doc), mail(std::move(e)), doc(nullptr), stylesheet(ss)
+ mail(std::move(e)), stylesheet(ss)
{
}
- XsltStreamSerializer::~XsltStreamSerializer()
- {
- delete doc;
- }
-
void
XsltStreamSerializer::Serialize(Slicer::ModelPartForRootPtr mp)
{
Slicer::XmlDocumentSerializer::Serialize(mp);
- auto result = std::shared_ptr<xmlDoc>(xsltApplyStylesheet(stylesheet, doc->cobj(), nullptr), xmlFreeDoc);
+ auto result = std::unique_ptr<xmlDoc, decltype(&xmlFreeDoc)>(
+ xsltApplyStylesheet(stylesheet, doc.cobj(), nullptr), xmlFreeDoc);
if (!result) {
throw xmlpp::exception("Failed to apply XSL transform");
}
diff --git a/gentoobrowse-api/service/xsltStreamSerializer.h b/gentoobrowse-api/service/xsltStreamSerializer.h
index f13f774..71f5e3f 100644
--- a/gentoobrowse-api/service/xsltStreamSerializer.h
+++ b/gentoobrowse-api/service/xsltStreamSerializer.h
@@ -14,8 +14,6 @@ namespace Gentoo {
class DLL_PUBLIC XsltStreamSerializer : public Slicer::XmlDocumentSerializer {
public:
XsltStreamSerializer(IceTray::Mail::EmailPtr, xsltStylesheet *);
- ~XsltStreamSerializer() override;
- SPECIAL_MEMBERS_DELETE(XsltStreamSerializer);
void Serialize(Slicer::ModelPartForRootPtr mp) override;
@@ -24,7 +22,6 @@ namespace Gentoo {
static IceTray::Mime::BasicPartPtr getText(xmlDoc *);
IceTray::Mail::EmailPtr mail;
- xmlpp::Document * doc;
xsltStylesheet * stylesheet;
};
}