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

Side by Side Diff: fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp

Issue 1579503002: XFA: Fix memory leakage on Linux - part 1 (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | xfa/src/fgas/include/fx_utl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "fpdfsdk/include/fsdk_define.h" 7 #include "fpdfsdk/include/fsdk_define.h"
8 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h" 8 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h"
9 #include "fpdfsdk/include/fsdk_mgr.h" 9 #include "fpdfsdk/include/fsdk_mgr.h"
10 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h" 10 #include "fpdfsdk/include/fpdfxfa/fpdfxfa_app.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 delete m_pPDFDoc; 58 delete m_pPDFDoc;
59 } 59 }
60 if (m_pXFADoc) { 60 if (m_pXFADoc) {
61 IXFA_App* pApp = m_pApp->GetXFAApp(); 61 IXFA_App* pApp = m_pApp->GetXFAApp();
62 if (pApp) { 62 if (pApp) {
63 IXFA_DocHandler* pDocHandler = pApp->GetDocHandler(); 63 IXFA_DocHandler* pDocHandler = pApp->GetDocHandler();
64 if (pDocHandler) { 64 if (pDocHandler) {
65 CloseXFADoc(pDocHandler); 65 CloseXFADoc(pDocHandler);
66 } 66 }
67 } 67 }
68 delete m_pXFADoc;
68 } 69 }
69 } 70 }
70 71
71 FX_BOOL CPDFXFA_Document::LoadXFADoc() { 72 FX_BOOL CPDFXFA_Document::LoadXFADoc() {
72 if (!m_pPDFDoc) 73 if (!m_pPDFDoc)
73 return FALSE; 74 return FALSE;
74 75
75 m_XFAPageList.RemoveAll(); 76 m_XFAPageList.RemoveAll();
76 77
77 IXFA_App* pApp = m_pApp->GetXFAApp(); 78 IXFA_App* pApp = m_pApp->GetXFAApp();
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1251 } 1252 }
1252 1253
1253 return _GetHValueByName(szPropName, hValue, 1254 return _GetHValueByName(szPropName, hValue,
1254 m_pSDKDoc->GetEnv()->GetJSRuntime()); 1255 m_pSDKDoc->GetEnv()->GetJSRuntime());
1255 } 1256 }
1256 FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name, 1257 FX_BOOL CPDFXFA_Document::_GetHValueByName(const CFX_ByteStringC& utf8Name,
1257 FXJSE_HVALUE hValue, 1258 FXJSE_HVALUE hValue,
1258 IJS_Runtime* runTime) { 1259 IJS_Runtime* runTime) {
1259 return runTime->GetHValueByName(utf8Name, hValue); 1260 return runTime->GetHValueByName(utf8Name, hValue);
1260 } 1261 }
OLDNEW
« no previous file with comments | « no previous file | xfa/src/fgas/include/fx_utl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698