summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/PWL_FontMap.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-08-24 11:12:19 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-24 11:12:19 -0700
commitcedaa557316a3f5c436814e69d67f19795f471d7 (patch)
tree128140994288bcd5b01f578e9dafc4bf1ea87493 /fpdfsdk/pdfwindow/PWL_FontMap.cpp
parentade4b495433751ac853f2d677b9e1da94d0d6bf7 (diff)
downloadpdfium-cedaa557316a3f5c436814e69d67f19795f471d7.tar.xz
Flip document and parser ownership
This Cl switches the ownership between the parser and the document. Previously the parser owned the document and we'd jump through hoops during cleanup to delete the right object. This Cl flips the ownership so the document owns the parser and simplifies the cleanup logic where needed. BUG=pdfium:565 Review-Url: https://codereview.chromium.org/2275773003
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_FontMap.cpp')
-rw-r--r--fpdfsdk/pdfwindow/PWL_FontMap.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
index 96acb78ec2..131334ac22 100644
--- a/fpdfsdk/pdfwindow/PWL_FontMap.cpp
+++ b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
@@ -9,6 +9,7 @@
#include "core/fpdfapi/fpdf_font/include/cpdf_font.h"
#include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h"
#include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
+#include "core/fpdfapi/fpdf_parser/include/cpdf_parser.h"
#include "core/fpdfapi/include/cpdf_modulemgr.h"
#include "core/fpdfdoc/include/ipvt_fontmap.h"
#include "fpdfsdk/pdfwindow/PWL_Wnd.h"
@@ -50,7 +51,7 @@ void CPWL_FontMap::SetSystemHandler(CFX_SystemHandler* pSystemHandler) {
CPDF_Document* CPWL_FontMap::GetDocument() {
if (!m_pPDFDoc) {
if (CPDF_ModuleMgr::Get()) {
- m_pPDFDoc.reset(new CPDF_Document(nullptr));
+ m_pPDFDoc.reset(new CPDF_Document(std::unique_ptr<CPDF_Parser>()));
m_pPDFDoc->CreateNewDoc();
}
}