diff options
author | tsepez <tsepez@chromium.org> | 2016-09-27 14:29:57 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-27 14:29:57 -0700 |
commit | f8074cefb2f8d947fa83d151bcbe080b485d6e6b (patch) | |
tree | fe97655234318181a58827666576010abb745b18 /fpdfsdk/javascript/Field.cpp | |
parent | ec7a9455c15b2cebb75a6036c8636beb601e543a (diff) | |
download | pdfium-f8074cefb2f8d947fa83d151bcbe080b485d6e6b.tar.xz |
Watch destruction of widgets around OnAAction() method.
We implemented the CFX_Observable mechanism for detecting
stale objects some time ago; now just use it in more places.
Change method signatures to required an ObservedPtr to
indicate that the callers are aware that the value may be
destroyed out from underneath them.
BUG=649659
Review-Url: https://codereview.chromium.org/2368403002
Diffstat (limited to 'fpdfsdk/javascript/Field.cpp')
-rw-r--r-- | fpdfsdk/javascript/Field.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp index 3abf0ecc7e..0534f47749 100644 --- a/fpdfsdk/javascript/Field.cpp +++ b/fpdfsdk/javascript/Field.cpp @@ -3222,7 +3222,8 @@ FX_BOOL Field::setFocus(IJS_Context* cc, } if (pWidget) { - m_pDocument->SetFocusAnnot(pWidget); + CPDFSDK_Annot::ObservedPtr pObserved(pWidget); + m_pDocument->SetFocusAnnot(&pObserved); } return TRUE; |