summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_structtree.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-01-26 16:37:20 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-01-30 20:12:16 +0000
commitf4a8c72d504e7f32fd55266a7cf1113667f695b1 (patch)
treea3bd0854de3cb3125bcd665cd96b5e655d534051 /fpdfsdk/fpdf_structtree.cpp
parent6db6df7735febef44a8b82ed2bd3ff038d4b8698 (diff)
downloadpdfium-f4a8c72d504e7f32fd55266a7cf1113667f695b1.tar.xz
Properly refcount CPDF_StructElement
Change-Id: Idc9921fe7389abea8e23f07a58fb6e7bfd1c09eb Reviewed-on: https://pdfium-review.googlesource.com/2433 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_structtree.cpp')
-rw-r--r--fpdfsdk/fpdf_structtree.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/fpdfsdk/fpdf_structtree.cpp b/fpdfsdk/fpdf_structtree.cpp
index 26ded3d460..5a922a1c3b 100644
--- a/fpdfsdk/fpdf_structtree.cpp
+++ b/fpdfsdk/fpdf_structtree.cpp
@@ -4,6 +4,8 @@
#include "public/fpdf_structtree.h"
+#include <memory>
+
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfdoc/fpdf_tagged.h"
@@ -30,7 +32,7 @@ DLLEXPORT FPDF_STRUCTTREE STDCALL FPDF_StructTree_GetForPage(FPDF_PAGE page) {
}
DLLEXPORT void STDCALL FPDF_StructTree_Close(FPDF_STRUCTTREE struct_tree) {
- delete ToStructTree(struct_tree);
+ std::unique_ptr<IPDF_StructTree>(ToStructTree(struct_tree));
}
DLLEXPORT int STDCALL