Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(113)

Unified Diff: fpdfsdk/fpdfview.cpp

Issue 2384243002: Guard against double deletion of page views. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« fpdfsdk/cpdfsdk_document.cpp ('K') | « fpdfsdk/cpdfsdk_pageview.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fpdfview.cpp
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 5c5532e0245ad53aaa02a97cafc5faa20f5152ab..e48c2e9eb14119923c312fed4fcefcc86e615967 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -670,6 +670,10 @@ DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page) {
CPDFSDK_PageView* pPageView =
static_cast<CPDFSDK_PageView*>(pPage->GetView());
if (pPageView) {
+ // We're already destroying the pageview, so bail early.
+ if (pPageView->IsBeingDestroyed())
+ return;
+
if (pPageView->IsLocked()) {
pPageView->TakePageOwnership();
return;
« fpdfsdk/cpdfsdk_document.cpp ('K') | « fpdfsdk/cpdfsdk_pageview.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698