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

Unified Diff: fpdfsdk/fpdfppo.cpp

Issue 2495003006: Fix unique ptrs in fpdfppo.cpp (Closed)
Patch Set: rebase 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 | « no previous file | fpdfsdk/fpdfppo_embeddertest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfppo.cpp
diff --git a/fpdfsdk/fpdfppo.cpp b/fpdfsdk/fpdfppo.cpp
index f8b96de1f379ad00c5e277d0e589f2a8ff687c5f..786bc466115ac97a5da50e66e9da860d69a36ff9 100644
--- a/fpdfsdk/fpdfppo.cpp
+++ b/fpdfsdk/fpdfppo.cpp
@@ -285,12 +285,12 @@ uint32_t CPDF_PageOrganizer::GetNewObjId(CPDF_Document* pDoc,
return 0;
}
}
- dwNewObjNum = pDoc->AddIndirectObject(pClone.get());
+ CPDF_Object* pUnownedClone = pClone.get();
+ dwNewObjNum = pDoc->AddIndirectObject(pClone.release());
(*pObjNumberMap)[dwObjnum] = dwNewObjNum;
- if (!UpdateReference(pClone.get(), pDoc, pObjNumberMap))
+ if (!UpdateReference(pUnownedClone, pDoc, pObjNumberMap))
return 0;
- pClone.release(); // TODO(tsepez): figure out ownership.
return dwNewObjNum;
}
« no previous file with comments | « no previous file | fpdfsdk/fpdfppo_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698