diff options
author | thestig <thestig@chromium.org> | 2016-05-31 05:46:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-31 05:46:52 -0700 |
commit | 4dce6d4689d464c3a8825a5d6aa790adfc9228ee (patch) | |
tree | 5be0b62c28735f57f53994a490581108cfdce829 /xfa/fxfa/include | |
parent | 8b3b3f59930eb29a80b3e83c0c724a50765b21f9 (diff) | |
download | pdfium-4dce6d4689d464c3a8825a5d6aa790adfc9228ee.tar.xz |
Fix a leak in CXFA_FontMgr.
Review-Url: https://codereview.chromium.org/2024713002
Diffstat (limited to 'xfa/fxfa/include')
-rw-r--r-- | xfa/fxfa/include/xfa_ffapp.h | 4 | ||||
-rw-r--r-- | xfa/fxfa/include/xfa_fontmgr.h | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/xfa/fxfa/include/xfa_ffapp.h b/xfa/fxfa/include/xfa_ffapp.h index c8df27da5b..191bb14174 100644 --- a/xfa/fxfa/include/xfa_ffapp.h +++ b/xfa/fxfa/include/xfa_ffapp.h @@ -36,7 +36,7 @@ class CXFA_FileRead : public IFX_FileRead { class CXFA_FFApp { public: - CXFA_FFApp(IXFA_AppProvider* pProvider); + explicit CXFA_FFApp(IXFA_AppProvider* pProvider); ~CXFA_FFApp(); CXFA_FFDocHandler* GetDocHandler(); @@ -45,7 +45,7 @@ class CXFA_FFApp { FX_BOOL bTakeOverFile); CXFA_FFDoc* CreateDoc(IXFA_DocProvider* pProvider, CPDF_Document* pPDFDoc); IXFA_AppProvider* GetAppProvider() { return m_pProvider; } - void SetDefaultFontMgr(CXFA_DefFontMgr* pFontMgr); + void SetDefaultFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr); CXFA_FWLAdapterWidgetMgr* GetWidgetMgr(CFWL_WidgetMgrDelegate* pDelegate); IFWL_AdapterTimerMgr* GetTimerMgr(); diff --git a/xfa/fxfa/include/xfa_fontmgr.h b/xfa/fxfa/include/xfa_fontmgr.h index d2e731769a..ab59df94c6 100644 --- a/xfa/fxfa/include/xfa_fontmgr.h +++ b/xfa/fxfa/include/xfa_fontmgr.h @@ -45,7 +45,7 @@ class CXFA_DefFontMgr { class CXFA_PDFFontMgr { public: - CXFA_PDFFontMgr(CXFA_FFDoc* pDoc); + explicit CXFA_PDFFontMgr(CXFA_FFDoc* pDoc); ~CXFA_PDFFontMgr(); IFX_Font* GetFont(const CFX_WideStringC& wsFontFamily, @@ -88,10 +88,10 @@ class CXFA_FontMgr { uint16_t wCodePage = 0xFFFF); void LoadDocFonts(CXFA_FFDoc* hDoc); void ReleaseDocFonts(CXFA_FFDoc* hDoc); - void SetDefFontMgr(CXFA_DefFontMgr* pFontMgr); + void SetDefFontMgr(std::unique_ptr<CXFA_DefFontMgr> pFontMgr); protected: - CXFA_DefFontMgr* m_pDefFontMgr; + std::unique_ptr<CXFA_DefFontMgr> m_pDefFontMgr; std::map<CXFA_FFDoc*, std::unique_ptr<CXFA_PDFFontMgr>> m_PDFFontMgrMap; std::map<CFX_ByteString, IFX_Font*> m_FontMap; }; |