Index: fpdfsdk/fpdfdoc_unittest.cpp |
diff --git a/fpdfsdk/fpdfdoc_unittest.cpp b/fpdfsdk/fpdfdoc_unittest.cpp |
index fc902570b41c22baf1712c46177f9a100f311388..7d1d6b4ba875d0c8b4e989698085134be46a88a1 100644 |
--- a/fpdfsdk/fpdfdoc_unittest.cpp |
+++ b/fpdfsdk/fpdfdoc_unittest.cpp |
@@ -81,8 +81,8 @@ class PDFDocTest : public testing::Test { |
std::vector<DictObjInfo> info; |
for (int i = 0; i < num; ++i) { |
// Objects created will be released by the document. |
- CPDF_Dictionary* obj = new CPDF_Dictionary(); |
- info.push_back({m_pIndirectObjs->AddIndirectObject(obj), obj}); |
+ CPDF_Dictionary* obj = m_pIndirectObjs->NewIndirect<CPDF_Dictionary>(); |
+ info.push_back({obj->GetObjNum(), obj}); |
} |
return info; |
} |