Skip to content

Commit

Permalink
Explicitly destroy PDFEngine in OutOfProcessInstance destructor
Browse files Browse the repository at this point in the history
During destruction, pdfium may call back into the instance and access members.
It would be better if this didn't happen but it isn't strictly wrong and may
be necessary as it appears pdfium can run scripts at shutdown.

BUG=485855
R=thestig@chromium.org

Review URL: https://codereview.chromium.org/1144923002

Cr-Commit-Position: refs/heads/master@{#330684}
  • Loading branch information
Raymes Khoury committed May 20, 2015
1 parent 5949548 commit 6c7398a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pdf/out_of_process_instance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ OutOfProcessInstance::OutOfProcessInstance(PP_Instance instance)

OutOfProcessInstance::~OutOfProcessInstance() {
RemovePerInstanceObject(kPPPPdfInterface, this);
// Explicitly reset the PDFEngine during destruction as it may call back into
// this object.
engine_.reset();
}

bool OutOfProcessInstance::Init(uint32_t argc,
Expand Down

0 comments on commit 6c7398a

Please sign in to comment.