summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_pageview.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-03 13:02:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-03 13:02:27 -0700
commitbcf46238b4533a9da91f4fa5d7248bbc85511dbd (patch)
tree755c25e5ffcf6eec6461097e0d4d366bde65a7c8 /fpdfsdk/cpdfsdk_pageview.h
parentd61f958385be285f3f3897ef3a3f010048608f1c (diff)
downloadpdfium-bcf46238b4533a9da91f4fa5d7248bbc85511dbd.tar.xz
Guard against double deletion of page views.
This CL adds a |IsBeingDestroyed| flag into the CPDFSDK_PageView. We then bail out of the pageview removal code early if the flag is set. BUG=chromium:652103 Review-Url: https://codereview.chromium.org/2384243002
Diffstat (limited to 'fpdfsdk/cpdfsdk_pageview.h')
-rw-r--r--fpdfsdk/cpdfsdk_pageview.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fpdfsdk/cpdfsdk_pageview.h b/fpdfsdk/cpdfsdk_pageview.h
index fe40300c23..f837ba5a91 100644
--- a/fpdfsdk/cpdfsdk_pageview.h
+++ b/fpdfsdk/cpdfsdk_pageview.h
@@ -98,6 +98,10 @@ class CPDFSDK_PageView final : public CPDF_Page::View {
void SetLock(FX_BOOL bLocked) { m_bLocked = bLocked; }
FX_BOOL IsLocked() { return m_bLocked; }
+
+ void SetBeingDestroyed() { m_bBeingDestroyed = true; }
+ bool IsBeingDestroyed() const { return m_bBeingDestroyed; }
+
#ifndef PDF_ENABLE_XFA
bool OwnsPage() const { return m_bOwnsPage; }
void TakePageOwnership() { m_bOwnsPage = true; }
@@ -120,6 +124,7 @@ class CPDFSDK_PageView final : public CPDF_Page::View {
FX_BOOL m_bOnWidget;
FX_BOOL m_bValid;
FX_BOOL m_bLocked;
+ bool m_bBeingDestroyed;
};
#endif // FPDFSDK_CPDFSDK_PAGEVIEW_H_