Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: fpdfsdk/fpdf_flatten.cpp

Issue 2484033002: Return unique_ptr from CPDF_Object::Clone(). (Closed)
Patch Set: std::move() it Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfdoc/cpvt_generateap.cpp ('k') | fpdfsdk/fpdfppo.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdf_flatten.cpp
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index 6cffbe0b3120dd2490ff89fe41808711f2e701c3..f39a50aad4b73728aff34ab281c7290ae0f24e56 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -408,8 +408,9 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
CPDF_Object* pObj = pAPStream;
if (pObj->IsInline()) {
- pObj = pObj->Clone();
- pDocument->AddIndirectObject(pObj);
+ std::unique_ptr<CPDF_Object> pNew = pObj->Clone();
+ pObj = pNew.get();
+ pDocument->AddIndirectObject(pNew.release());
}
CPDF_Dictionary* pObjDic = pObj->GetDict();
« no previous file with comments | « core/fpdfdoc/cpvt_generateap.cpp ('k') | fpdfsdk/fpdfppo.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698