From 28a4a2410f24910c709578d981cae3bb8153fdba Mon Sep 17 00:00:00 2001 From: dsinclair Date: Mon, 22 Aug 2016 13:36:02 -0700 Subject: 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 --- fpdfsdk/formfiller/cffl_combobox.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fpdfsdk/formfiller/cffl_combobox.cpp') diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp index 35591cff74..f6aef20c02 100644 --- a/fpdfsdk/formfiller/cffl_combobox.cpp +++ b/fpdfsdk/formfiller/cffl_combobox.cpp @@ -24,6 +24,11 @@ CFFL_ComboBox::CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot) CFFL_ComboBox::~CFFL_ComboBox() { for (const auto& it : m_Maps) it.second->InvalidateFocusHandler(this); + + // See comment in cffl_formfiller.h. + // The font map should be stored somewhere more appropriate so it will live + // until the PWL_Edit is done with it. pdfium:566 + DestroyWindows(); delete m_pFontMap; } -- cgit v1.2.3