summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fpdfview.cpp')
-rw-r--r--fpdfsdk/src/fpdfview.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp
index 49dabe300b..bd49862e1c 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;
}