diff options
author | tsepez <tsepez@chromium.org> | 2016-10-14 16:59:10 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-14 16:59:10 -0700 |
commit | 3ba098595ae56b64eacc0c25ab76b89a4d78d920 (patch) | |
tree | 5c4db47295ea64cdf236c32ef7d5af5b8e7af232 /core/fpdfapi/edit/fpdf_edit_create.cpp | |
parent | 1d023881cd53485303c0fcc0b5878e700dc470fd (diff) | |
download | pdfium-3ba098595ae56b64eacc0c25ab76b89a4d78d920.tar.xz |
Update CPDF_IndirectObjectHolder APIs for unique objects.
Doing so highlights a few places where ownership is dubious.
Add convenience functions to return an unowned reference to
a newly-created indirect object.
Review-Url: https://codereview.chromium.org/2419173002
Diffstat (limited to 'core/fpdfapi/edit/fpdf_edit_create.cpp')
-rw-r--r-- | core/fpdfapi/edit/fpdf_edit_create.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/fpdfapi/edit/fpdf_edit_create.cpp b/core/fpdfapi/edit/fpdf_edit_create.cpp index fae2b14449..5622b1dae7 100644 --- a/core/fpdfapi/edit/fpdf_edit_create.cpp +++ b/core/fpdfapi/edit/fpdf_edit_create.cpp @@ -1244,12 +1244,10 @@ int32_t CPDF_Creator::WriteOldIndirectObject(uint32_t objnum) { m_ObjectOffset[objnum] = 0; return 0; } - if (WriteIndirectObj(pObj)) { + if (WriteIndirectObj(pObj)) return -1; - } - if (!bExistInMap) { - m_pDocument->ReleaseIndirectObject(objnum); - } + if (!bExistInMap) + m_pDocument->DeleteIndirectObject(objnum); } else { uint8_t* pBuffer; uint32_t size; |