1 // Copyright 2014 PDFium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #include "JBig2_SymbolDict.h" 8 CJBig2_SymbolDict::CJBig2_SymbolDict() 9 { 10 SDNUMEXSYMS = 0; 11 SDEXSYMS = NULL; 12 m_bContextRetained = FALSE; 13 m_gbContext = m_grContext = NULL; 14 } 15 16 CJBig2_SymbolDict::~CJBig2_SymbolDict() 17 { 18 if(SDEXSYMS) { 19 for(FX_DWORD i = 0; i < SDNUMEXSYMS; i++) { 20 if(SDEXSYMS[i]) { 21 delete SDEXSYMS[i]; 22 } 23 } 24 m_pModule->JBig2_Free(SDEXSYMS); 25 } 26 if(m_bContextRetained) { 27 if(m_gbContext) { 28 m_pModule->JBig2_Free(m_gbContext); 29 } 30 if(m_grContext) { 31 m_pModule->JBig2_Free(m_grContext); 32 } 33 } 34 } 35