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

Unified Diff: fpdfsdk/formfiller/cffl_combobox.cpp

Issue 2266943002: Destroy window before cleaning up combobox (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Destroy window before cleaning up combobox Created 4 years, 4 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 | fpdfsdk/formfiller/cffl_formfiller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/formfiller/cffl_combobox.cpp
diff --git a/fpdfsdk/formfiller/cffl_combobox.cpp b/fpdfsdk/formfiller/cffl_combobox.cpp
index 35591cff74215cf68a46fbcf02c187925b7214da..42405cbb223bea9d002128da321c4ea64b527597 100644
--- a/fpdfsdk/formfiller/cffl_combobox.cpp
+++ b/fpdfsdk/formfiller/cffl_combobox.cpp
@@ -24,6 +24,14 @@ CFFL_ComboBox::CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot)
CFFL_ComboBox::~CFFL_ComboBox() {
for (const auto& it : m_Maps)
it.second->InvalidateFocusHandler(this);
+
+ // The combo box must destroy the window before it frees the font map because
+ // when the window destroys the PWL_Edit the edit will update the selection
+ // which requires getting the font data from the font map.
+ //
+ // The font map should be stored somewhere more appropriate so it will live
+ // until the PWL_Edit is done with it. pdfium:566
Wei Li 2016/08/22 19:26:56 Does this only happen to ComboBox? How about ListB
dsinclair 2016/08/22 19:32:08 It doesn't look like ListBox has this issue as it
+ DestroyWindows();
delete m_pFontMap;
}
« no previous file with comments | « no previous file | fpdfsdk/formfiller/cffl_formfiller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698