summaryrefslogtreecommitdiff
path: root/fpdfsdk/formfiller/cffl_formfiller.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-01-19 13:53:02 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-01-19 19:47:44 +0000
commitbc8dcc3ede286fbcaac3f741c379297cffff0eea (patch)
tree4eb364ea4def674590d8ead928f39247aad70c37 /fpdfsdk/formfiller/cffl_formfiller.cpp
parent352b6971deeb8e7438b6880fd4a26fd3f9382c47 (diff)
downloadpdfium-bc8dcc3ede286fbcaac3f741c379297cffff0eea.tar.xz
Add ObservedPtrs to PWL_CREATEPARAM
It's possible for both the provider and attached widget to be destroyed before the PWL_CREATEPARAM objects which point to them. This causes issues when those widgets access their attached widget or provider. This CL wraps the pAttachedWidget and pProvider into ObservedPtrs so we will know if the underlying pointer has gone away. BUG=chromium:681351 Change-Id: Ib40445be9487dc3e89a66bb7407abdeed7d2c946 Reviewed-on: https://pdfium-review.googlesource.com/2270 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/formfiller/cffl_formfiller.cpp')
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index 7c1dec46b3..281057a6ac 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -289,7 +289,7 @@ PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() {
PWL_CREATEPARAM cp;
cp.pParentWnd = nullptr;
- cp.pProvider = this;
+ cp.pProvider.Reset(this);
cp.rcRectWnd = GetPDFWindowRect();
uint32_t dwCreateFlags = PWS_BORDER | PWS_BACKGROUND | PWS_VISIBLE;
@@ -359,7 +359,7 @@ CPWL_Wnd* CFFL_FormFiller::GetPDFWindow(CPDFSDK_PageView* pPageView,
}
} else {
PWL_CREATEPARAM cp = GetCreateParam();
- cp.pAttachedWidget = m_pWidget;
+ cp.pAttachedWidget.Reset(m_pWidget);
CFFL_PrivateData* pPrivateData = new CFFL_PrivateData;
pPrivateData->pWidget = m_pWidget;