OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../include/fxcrt/fx_xml.h" | 7 #include "../../include/fxcrt/fx_xml.h" |
8 #include "xml_int.h" | 8 #include "xml_int.h" |
9 CXML_Parser::~CXML_Parser() | 9 CXML_Parser::~CXML_Parser() |
10 { | 10 { |
11 if (m_bOwnedStream) { | 11 if (m_bOwnedStream && m_pDataAcc) { |
12 m_pDataAcc->Release(); | 12 m_pDataAcc->Release(); |
13 } | 13 } |
14 } | 14 } |
15 FX_BOOL CXML_Parser::Init(FX_LPBYTE pBuffer, size_t size) | 15 FX_BOOL CXML_Parser::Init(FX_LPBYTE pBuffer, size_t size) |
16 { | 16 { |
17 if (m_pAllocator) { | 17 if (m_pAllocator) { |
18 m_pDataAcc = FX_NewAtAllocator(m_pAllocator)CXML_DataBufAcc(pBuffer, siz
e, m_pAllocator); | 18 m_pDataAcc = FX_NewAtAllocator(m_pAllocator)CXML_DataBufAcc(pBuffer, siz
e, m_pAllocator); |
19 } else { | 19 } else { |
20 m_pDataAcc = FX_NEW CXML_DataBufAcc(pBuffer, size, NULL); | 20 m_pDataAcc = FX_NEW CXML_DataBufAcc(pBuffer, size, NULL); |
21 } | 21 } |
(...skipping 986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 item.Empty(pAllocator); | 1008 item.Empty(pAllocator); |
1009 } | 1009 } |
1010 m_pMap->RemoveAll(); | 1010 m_pMap->RemoveAll(); |
1011 if (pAllocator) { | 1011 if (pAllocator) { |
1012 FX_DeleteAtAllocator(m_pMap, pAllocator, CFX_ObjectArray<CXML_AttrItem>)
; | 1012 FX_DeleteAtAllocator(m_pMap, pAllocator, CFX_ObjectArray<CXML_AttrItem>)
; |
1013 } else { | 1013 } else { |
1014 delete m_pMap; | 1014 delete m_pMap; |
1015 } | 1015 } |
1016 m_pMap = NULL; | 1016 m_pMap = NULL; |
1017 } | 1017 } |
OLD | NEW |