diff options
Diffstat (limited to 'core/fpdfdoc/cpdf_annot.cpp')
-rw-r--r-- | core/fpdfdoc/cpdf_annot.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp index 6525ff620c..942d334a2d 100644 --- a/core/fpdfdoc/cpdf_annot.cpp +++ b/core/fpdfdoc/cpdf_annot.cpp @@ -18,8 +18,11 @@ #include "core/fxge/include/cfx_pathdata.h" #include "core/fxge/include/cfx_renderdevice.h" -CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument) - : m_pAnnotDict(pDict), +CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict, + CPDF_Document* pDocument, + bool bToOwnDict) + : m_bOwnedAnnotDict(bToOwnDict), + m_pAnnotDict(pDict), m_pDocument(pDocument), m_bOpenState(false), m_pPopupAnnot(nullptr) { @@ -28,6 +31,8 @@ CPDF_Annot::CPDF_Annot(CPDF_Dictionary* pDict, CPDF_Document* pDocument) } CPDF_Annot::~CPDF_Annot() { + if (m_bOwnedAnnotDict) + m_pAnnotDict->Release(); ClearCachedAP(); } |