Index: fpdfsdk/src/fpdfview.cpp |
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp |
index 49dabe300b4d43038f0308447f014747460d260a..bd49862e1c2f7e088cd3e86a607abcff3d087db5 100644 |
--- a/fpdfsdk/src/fpdfview.cpp |
+++ b/fpdfsdk/src/fpdfview.cpp |
@@ -5,6 +5,7 @@ |
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
#include "../include/fsdk_define.h" |
+#include "../include/fsdk_mgr.h" |
#include "../include/fpdfview.h" |
#include "../include/fsdk_rendercontext.h" |
#include "../include/fpdf_progressive.h" |
@@ -591,6 +592,11 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, |
DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page) |
{ |
if (!page) return; |
+ CPDFSDK_PageView* pPageView = (CPDFSDK_PageView*)(((CPDF_Page*)page))->GetPrivateData((FX_LPVOID)page); |
+ if (pPageView && pPageView->IsLocked()) { |
+ pPageView->TakeOverPage(); |
+ return; |
+ } |
delete (CPDF_Page*)page; |
} |