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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 544873002: PDFiumEngine::~PDFiumEngine - Unload all pages_ before destroying any of them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_page.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 83c83f4fe439c59c8d971de0d1fbe68ba1d1fda5..e6713271139afb89d816956c6a3d07bbd1b41917 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -598,7 +598,9 @@ PDFiumEngine::PDFiumEngine(PDFEngine::Client* client)
}
PDFiumEngine::~PDFiumEngine() {
- STLDeleteElements(&pages_);
+ for (size_t i = 0; i < pages_.size(); ++i)
+ pages_[i]->Unload();
+
if (doc_) {
if (form_) {
FORM_DoDocumentAAction(form_, FPDFDOC_AACTION_WC);
@@ -609,6 +611,8 @@ PDFiumEngine::~PDFiumEngine() {
if (fpdf_availability_)
FPDFAvail_Destroy(fpdf_availability_);
+
+ STLDeleteElements(&pages_);
}
int PDFiumEngine::GetBlock(void* param, unsigned long position,
« no previous file with comments | « no previous file | pdf/pdfium/pdfium_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698