diff options
author | Nicolas Pena <npm@chromium.org> | 2017-07-13 10:06:15 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-13 14:29:34 +0000 |
commit | 17453d03c3bdd18a893ae86058a6184939aee026 (patch) | |
tree | 2a87278c98e851744f20cd9aaa1460f849ef097e /core/fxcodec/jbig2/JBig2_Segment.cpp | |
parent | 360d1fce569b57aa2c487f6e171ba19b9dc8885e (diff) | |
download | pdfium-17453d03c3bdd18a893ae86058a6184939aee026.tar.xz |
More unique_ptrs in JBig2 code
This CL makes CJBig2_Segment own the results: symbol, pattern, huffman,
and huffman. This causes a lot more unique_ptr usage in JBig2 code.
Change-Id: I1f0a5bfaaf85053658b467bef5325c72d1f496c7
Reviewed-on: https://pdfium-review.googlesource.com/7690
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_Segment.cpp')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_Segment.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/core/fxcodec/jbig2/JBig2_Segment.cpp b/core/fxcodec/jbig2/JBig2_Segment.cpp index 610246b6e2..886989abd8 100644 --- a/core/fxcodec/jbig2/JBig2_Segment.cpp +++ b/core/fxcodec/jbig2/JBig2_Segment.cpp @@ -20,25 +20,8 @@ CJBig2_Segment::CJBig2_Segment() { m_dwDataOffset = 0; m_State = JBIG2_SEGMENT_HEADER_UNPARSED; m_nResultType = JBIG2_VOID_POINTER; - m_Result.vd = nullptr; } + CJBig2_Segment::~CJBig2_Segment() { FX_Free(m_pReferred_to_segment_numbers); - - switch (m_nResultType) { - case JBIG2_IMAGE_POINTER: - delete m_Result.im; - break; - case JBIG2_SYMBOL_DICT_POINTER: - delete m_Result.sd; - break; - case JBIG2_PATTERN_DICT_POINTER: - delete m_Result.pd; - break; - case JBIG2_HUFFMAN_TABLE_POINTER: - delete m_Result.ht; - break; - default: - FX_Free(m_Result.vd); - } } |