diff options
author | dsinclair <dsinclair@chromium.org> | 2016-08-22 13:36:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-08-22 13:36:02 -0700 |
commit | 28a4a2410f24910c709578d981cae3bb8153fdba (patch) | |
tree | aa3a65e4eed59d14872a8d322f772a3b5ba6b531 /fpdfsdk/formfiller/cffl_formfiller.cpp | |
parent | 236e47afa53d3f065024cc6490a49b431c108078 (diff) | |
download | pdfium-28a4a2410f24910c709578d981cae3bb8153fdba.tar.xz |
Destroy window before cleaning up combobox
Currently, when we destroy a CFFL_ComboBox we'll cleanup the fontmap and then
call the destructor for the parent type. This will case the PWL_Wnd to be
destroyed. In this case, the window is a PWL_Edit. On destruction it will reset
the focus which causes the text selection to change, which asks the font map
for data but we've already destroyed the font map.
This CL forces the destruction of the window earlier in order to have the
fontmap available. A followup bug is filed to correct the location of the
fontmap so we don't have this dependency.
BUG=chromium:637546
Review-Url: https://codereview.chromium.org/2266943002
Diffstat (limited to 'fpdfsdk/formfiller/cffl_formfiller.cpp')
-rw-r--r-- | fpdfsdk/formfiller/cffl_formfiller.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp index f2c34647d0..92e9282a74 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.cpp +++ b/fpdfsdk/formfiller/cffl_formfiller.cpp @@ -27,6 +27,10 @@ CFFL_FormFiller::CFFL_FormFiller(CPDFDoc_Environment* pApp, } CFFL_FormFiller::~CFFL_FormFiller() { + DestroyWindows(); +} + +void CFFL_FormFiller::DestroyWindows() { for (const auto& it : m_Maps) { CPWL_Wnd* pWnd = it.second; CFFL_PrivateData* pData = (CFFL_PrivateData*)pWnd->GetAttachedData(); |