summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_listbox.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-10-24 23:56:43 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-24 23:56:43 +0000
commit333165a2c7b7812effdea3cd1ae386850cd3f310 (patch)
tree9d3c0757b745bbc3789b282e5aeb931f7a47880e /fpdfsdk/formfiller/cffl_listbox.h
parent98d1b48e9a3471a02968f3d12692645fa0fcb50d (diff)
downloadpdfium-333165a2c7b7812effdea3cd1ae386850cd3f310.tar.xz
Fix CPLW_Wnd ownership model in CFFL_FormFiller.
CFFL_FormFiller::DestroyPDFWindow() might get re-entered, so do not leave any dangling references in maps. Use unique_ptr to be more sure that we have it right. Bug: chromium:898531 Change-Id: I7b61940ff4e88c8a7e3219fefb0479f33bbbfae1 Reviewed-on: https://pdfium-review.googlesource.com/c/44542 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/formfiller/cffl_listbox.h')
-rw-r--r--fpdfsdk/formfiller/cffl_listbox.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/fpdfsdk/formfiller/cffl_listbox.h b/fpdfsdk/formfiller/cffl_listbox.h
index eda9561780..eed542fde5 100644
--- a/fpdfsdk/formfiller/cffl_listbox.h
+++ b/fpdfsdk/formfiller/cffl_listbox.h
@@ -7,6 +7,7 @@
#ifndef FPDFSDK_FORMFILLER_CFFL_LISTBOX_H_
#define FPDFSDK_FORMFILLER_CFFL_LISTBOX_H_
+#include <memory>
#include <set>
#include <vector>
@@ -21,7 +22,8 @@ class CFFL_ListBox final : public CFFL_TextObject {
// CFFL_TextObject:
CPWL_Wnd::CreateParams GetCreateParam() override;
- CPWL_Wnd* NewPDFWindow(const CPWL_Wnd::CreateParams& cp) override;
+ std::unique_ptr<CPWL_Wnd> NewPDFWindow(
+ const CPWL_Wnd::CreateParams& cp) override;
bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags) override;
bool IsDataChanged(CPDFSDK_PageView* pPageView) override;
void SaveData(CPDFSDK_PageView* pPageView) override;