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

Unified Diff: core/fpdfdoc/cpdf_annot.cpp

Issue 2301613002: Fix leaks due to created popup annotations (Closed)
Patch Set: fix typo Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/fpdfdoc/cpdf_annotlist.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_annot.cpp
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp
index 6525ff620cc282ffb24e54d50fc31091395d7722..942d334a2d87c9b206131c9e52e6719050b2d29c 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();
}
« no previous file with comments | « no previous file | core/fpdfdoc/cpdf_annotlist.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698