summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_textobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/formfiller/cffl_textobject.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_textobject.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/fpdfsdk/formfiller/cffl_textobject.cpp b/fpdfsdk/formfiller/cffl_textobject.cpp
index d84557eb88..df2f5e5a92 100644
--- a/fpdfsdk/formfiller/cffl_textobject.cpp
+++ b/fpdfsdk/formfiller/cffl_textobject.cpp
@@ -24,7 +24,11 @@ CFFL_TextObject::CFFL_TextObject(CPDFSDK_FormFillEnvironment* pApp,
CPDFSDK_Widget* pWidget)
: CFFL_FormFiller(pApp, pWidget) {}
-CFFL_TextObject::~CFFL_TextObject() {}
+CFFL_TextObject::~CFFL_TextObject() {
+ // Destroy view classes before this object's members are destroyed since
+ // the view classes have pointers to m_pFontMap that would be left dangling.
+ DestroyWindows();
+}
CBA_FontMap* CFFL_TextObject::MaybeCreateFontMap() {
if (!m_pFontMap) {