diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-05-26 13:08:36 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-05-26 20:46:30 +0000 |
commit | 385d32f64613f08bad5cb63f0b8dc4f847f240f4 (patch) | |
tree | ed835312989fcf493328605b423ef67faa69f64a /core/fpdfapi | |
parent | 06bbdef296b483e6f666156b198319019d3c6373 (diff) | |
download | pdfium-385d32f64613f08bad5cb63f0b8dc4f847f240f4.tar.xz |
Fix CPDF_PageRenderContext cleanup
Make CFX_RenderDevice, which owns the IFX_RenderDeviceDriver, responsible
for restoring driver state as part of its destruction so that its callers
don't have to do so out of turn.
Then re-order CPDF_PageRenderContext destruction order so that
the progressive renderer is destroyed before the device, and the
device destroyed before the options because of unowned pointers
to objects owned by these.
Bug: 726755
Change-Id: I9a6f23da12140b2758b86e6f33f715ad1c679c3f
Reviewed-on: https://pdfium-review.googlesource.com/6073
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi')
-rw-r--r-- | core/fpdfapi/cpdf_pagerendercontext.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/fpdfapi/cpdf_pagerendercontext.h b/core/fpdfapi/cpdf_pagerendercontext.h index 27244e7fc3..5cbcdb7759 100644 --- a/core/fpdfapi/cpdf_pagerendercontext.h +++ b/core/fpdfapi/cpdf_pagerendercontext.h @@ -21,11 +21,12 @@ class CPDF_PageRenderContext { CPDF_PageRenderContext(); ~CPDF_PageRenderContext(); + // Specific destruction order required. std::unique_ptr<CPDF_AnnotList> m_pAnnots; + std::unique_ptr<CPDF_RenderOptions> m_pOptions; std::unique_ptr<CFX_RenderDevice> m_pDevice; std::unique_ptr<CPDF_RenderContext> m_pContext; std::unique_ptr<CPDF_ProgressiveRenderer> m_pRenderer; - std::unique_ptr<CPDF_RenderOptions> m_pOptions; }; #endif // CORE_FPDFAPI_CPDF_PAGERENDERCONTEXT_H_ |