Index: src/pdf/SkPDFDocument.cpp |
diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp |
index 8e884d5e834f20e5859a57ea0a3963168be92733..cf312e55fbc3c171b7c7121719066872ed244295 100644 |
--- a/src/pdf/SkPDFDocument.cpp |
+++ b/src/pdf/SkPDFDocument.cpp |
@@ -14,11 +14,16 @@ |
#include "SkPDFUtils.h" |
#include "SkStream.h" |
- |
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(); |
+ } |
+} |
+ |
void SkPDFObjectSerializer::addObjectRecursively(const sk_sp<SkPDFObject>& object) { |
fObjNumMap.addObjectRecursively(object.get(), fSubstituteMap); |
} |