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

Issue 2301613002: Fix leaks due to created popup annotations (Closed)

Created:
4 years, 3 months ago by Wei Li
Modified:
4 years, 3 months ago
CC:
pdfium-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

Fix leaks due to created popup annotations When we create popup annotations, we also create the dictionary associated with it. For regular annotations, the dictionary associated with an annotation is not owned by annotation, and will be released separately. But our created dictionary is not associated with any other data structure, it would be leaked if not released by the associated annotation. Add a boolean to indicate the ownership to the dictionary, and release the owned dictionary during the destruction of an annotation. BUG=pdfium:242 Committed: https://pdfium.googlesource.com/pdfium/+/7c5d090719a25f0c1b81fb6b46544b9394a7fdd2

Patch Set 1 #

Total comments: 5

Patch Set 2 : fix typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -6 lines) Patch
M core/fpdfdoc/cpdf_annot.cpp View 2 chunks +7 lines, -2 lines 0 comments Download
M core/fpdfdoc/cpdf_annotlist.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M core/fpdfdoc/include/cpdf_annot.h View 1 2 chunks +6 lines, -2 lines 0 comments Download

Messages

Total messages: 28 (18 generated)
Wei Li
pls review, thanks
4 years, 3 months ago (2016-08-31 19:52:41 UTC) #6
Lei Zhang
4 years, 3 months ago (2016-08-31 20:17:52 UTC) #8
dsinclair
https://codereview.chromium.org/2301613002/diff/1/core/fpdfdoc/cpdf_annotlist.cpp File core/fpdfdoc/cpdf_annotlist.cpp (right): https://codereview.chromium.org/2301613002/diff/1/core/fpdfdoc/cpdf_annotlist.cpp#newcode77 core/fpdfdoc/cpdf_annotlist.cpp:77: pDict = pAnnots->GetDictAt(i); Could we clone the dictionary at ...
4 years, 3 months ago (2016-08-31 20:28:31 UTC) #9
Wei Li
On 2016/08/31 20:28:31, dsinclair wrote: > https://codereview.chromium.org/2301613002/diff/1/core/fpdfdoc/cpdf_annotlist.cpp > File core/fpdfdoc/cpdf_annotlist.cpp (right): > > https://codereview.chromium.org/2301613002/diff/1/core/fpdfdoc/cpdf_annotlist.cpp#newcode77 > ...
4 years, 3 months ago (2016-08-31 21:13:57 UTC) #10
Lei Zhang
https://codereview.chromium.org/2301613002/diff/1/core/fpdfdoc/cpdf_annotlist.cpp File core/fpdfdoc/cpdf_annotlist.cpp (right): https://codereview.chromium.org/2301613002/diff/1/core/fpdfdoc/cpdf_annotlist.cpp#newcode31 core/fpdfdoc/cpdf_annotlist.cpp:31: CPDF_Dictionary* pAnnotDict = new CPDF_Dictionary; Alternatively, we can have ...
4 years, 3 months ago (2016-09-01 03:53:13 UTC) #11
Wei Li
https://codereview.chromium.org/2301613002/diff/1/core/fpdfdoc/cpdf_annotlist.cpp File core/fpdfdoc/cpdf_annotlist.cpp (right): https://codereview.chromium.org/2301613002/diff/1/core/fpdfdoc/cpdf_annotlist.cpp#newcode31 core/fpdfdoc/cpdf_annotlist.cpp:31: CPDF_Dictionary* pAnnotDict = new CPDF_Dictionary; On 2016/09/01 03:53:12, Lei ...
4 years, 3 months ago (2016-09-01 19:08:34 UTC) #20
dsinclair
lgtm
4 years, 3 months ago (2016-09-01 19:24:33 UTC) #21
Lei Zhang
On 2016/09/01 19:08:34, Wei Li wrote: > https://codereview.chromium.org/2301613002/diff/1/core/fpdfdoc/cpdf_annotlist.cpp > File core/fpdfdoc/cpdf_annotlist.cpp (right): > > https://codereview.chromium.org/2301613002/diff/1/core/fpdfdoc/cpdf_annotlist.cpp#newcode31 ...
4 years, 3 months ago (2016-09-01 20:42:47 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2301613002/60001
4 years, 3 months ago (2016-09-01 21:39:32 UTC) #26
commit-bot: I haz the power
4 years, 3 months ago (2016-09-01 21:39:44 UTC) #28
Message was sent while issue was closed.
Committed patchset #2 (id:60001) as
https://pdfium.googlesource.com/pdfium/+/7c5d090719a25f0c1b81fb6b46544b9394a7...

Powered by Google App Engine
This is Rietveld 408576698