summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fsdk_mgr.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/fpdfsdk/fsdk_mgr.cpp b/fpdfsdk/fsdk_mgr.cpp
index 68143d2bdd..d1e55074f9 100644
--- a/fpdfsdk/fsdk_mgr.cpp
+++ b/fpdfsdk/fsdk_mgr.cpp
@@ -353,9 +353,12 @@ void CPDFSDK_Document::RemovePageView(UnderlyingPageType* pUnderlyingPage) {
if (pPageView->IsLocked())
return;
+ // Remove the page from the map to make sure we don't accidentally attempt
+ // to use the |pPageView| while we're cleaning it up.
+ m_pageMap.erase(it);
+
pPageView->KillFocusAnnotIfNeeded();
delete pPageView;
- m_pageMap.erase(it);
}
UnderlyingPageType* CPDFSDK_Document::GetPage(int nIndex) {