summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fpdfsdk/pdfwindow/PWL_ListBox.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
index e8c1f82bde..c8a554b0f8 100644
--- a/fpdfsdk/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
@@ -94,6 +94,10 @@ void CPWL_ListBox::OnCreated() {
}
void CPWL_ListBox::OnDestroy() {
+ // Make sure the notifier is removed from the list as we are about to
+ // destroy the notifier and don't want to leave a dangling pointer.
+ if (m_pList)
+ m_pList->SetNotify(nullptr);
m_pListNotify.reset();
}