From b86544285e263310c1017a3aa056d71e68c5d5a1 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 26 Jun 2018 15:19:38 +0000 Subject: Make CPDF_Document::m_pRootDict an UnownedPtr<>. In turn, this requires making some of the tests use an indirect root dictionary so as to satisfy the lifetime requirements. Change-Id: Ibdbe294a76200d4486134e5848c169a6c2d802bf Reviewed-on: https://pdfium-review.googlesource.com/36110 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fpdfsdk/fpdf_doc_unittest.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'fpdfsdk') diff --git a/fpdfsdk/fpdf_doc_unittest.cpp b/fpdfsdk/fpdf_doc_unittest.cpp index 0234d47833..58b8ffd42d 100644 --- a/fpdfsdk/fpdf_doc_unittest.cpp +++ b/fpdfsdk/fpdf_doc_unittest.cpp @@ -42,13 +42,13 @@ class PDFDocTest : public testing::Test { CPDF_ModuleMgr::Get()->Init(); auto pTestDoc = pdfium::MakeUnique(); m_pIndirectObjs = pTestDoc->GetHolder(); - m_pRootObj = pdfium::MakeUnique(); - pTestDoc->SetRoot(m_pRootObj.get()); + m_pRootObj = m_pIndirectObjs->NewIndirect(); + pTestDoc->SetRoot(m_pRootObj.Get()); m_pDoc.reset(FPDFDocumentFromCPDFDocument(pTestDoc.release())); } void TearDown() override { - m_pRootObj.reset(); + m_pRootObj = nullptr; m_pIndirectObjs = nullptr; m_pDoc.reset(); CPDF_ModuleMgr::Destroy(); @@ -67,7 +67,7 @@ class PDFDocTest : public testing::Test { protected: ScopedFPDFDocument m_pDoc; UnownedPtr m_pIndirectObjs; - std::unique_ptr m_pRootObj; + UnownedPtr m_pRootObj; }; TEST_F(PDFDocTest, FindBookmark) { -- cgit v1.2.3