diff options
Diffstat (limited to 'src/pdf/SkPDFDocument.cpp')
-rw-r--r-- | src/pdf/SkPDFDocument.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp index 5668f29d2c..16f0c11a40 100644 --- a/src/pdf/SkPDFDocument.cpp +++ b/src/pdf/SkPDFDocument.cpp @@ -16,13 +16,14 @@ SkPDFObjectSerializer::SkPDFObjectSerializer() : fBaseOffset(0), fNextToBeSerialized(0) {} -template <class T> static void renew(T* t) { t->~T(); new (t) T; } - SkPDFObjectSerializer::~SkPDFObjectSerializer() { for (int i = 0; i < fObjNumMap.objects().count(); ++i) { fObjNumMap.objects()[i]->drop(); } } +SkPDFObjectSerializer::SkPDFObjectSerializer(SkPDFObjectSerializer&&) = default; +SkPDFObjectSerializer& SkPDFObjectSerializer::operator=(SkPDFObjectSerializer&&) = default; + void SkPDFObjectSerializer::addObjectRecursively(const sk_sp<SkPDFObject>& object) { fObjNumMap.addObjectRecursively(object.get()); @@ -242,8 +243,8 @@ void SkPDFDocument::onAbort() { void SkPDFDocument::reset() { fCanvas.reset(nullptr); fPages.reset(); - renew(&fCanon); - renew(&fObjectSerializer); + fCanon = SkPDFCanon(); + fObjectSerializer = SkPDFObjectSerializer(); fFonts.reset(); } |