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

Unified Diff: core/src/fxcodec/jbig2/JBig2_Segment.cpp

Issue 1332153002: Merge to XFA: Make a bunch of JBig2 classes independent of CJBig2_Object. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 3 months 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/src/fxcodec/jbig2/JBig2_Segment.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcodec/jbig2/JBig2_Segment.cpp
diff --git a/core/src/fxcodec/jbig2/JBig2_Segment.cpp b/core/src/fxcodec/jbig2/JBig2_Segment.cpp
index 39e4fafaa1fe30dcda7b4e481b38510683deda30..7ad55f3515d4b9f39f57b203c5a17fb6c43e023d 100644
--- a/core/src/fxcodec/jbig2/JBig2_Segment.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_Segment.cpp
@@ -5,6 +5,9 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "JBig2_Segment.h"
+
+#include "../../../include/fxcrt/fx_memory.h"
+
CJBig2_Segment::CJBig2_Segment() {
m_dwNumber = 0;
m_cFlags.c = 0;
@@ -19,28 +22,22 @@ CJBig2_Segment::CJBig2_Segment() {
m_Result.vd = NULL;
}
CJBig2_Segment::~CJBig2_Segment() {
- clean();
-}
-void CJBig2_Segment::clean() {
- if (m_pReferred_to_segment_numbers) {
- m_pModule->JBig2_Free(m_pReferred_to_segment_numbers);
- }
- if (m_Result.vd) {
- 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:
- m_pModule->JBig2_Free(m_Result.vd);
- }
+ 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);
}
}
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_Segment.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698