Index: pdf/instance.cc |
diff --git a/pdf/instance.cc b/pdf/instance.cc |
index 0feeff4b8b9709f1ec023c7f72d81f600e607729..a5c529e7c848cbbb7d26faf4611537ddd0310b18 100644 |
--- a/pdf/instance.cc |
+++ b/pdf/instance.cc |
@@ -307,6 +307,9 @@ Instance::Instance(PP_Instance instance) |
} |
Instance::~Instance() { |
+ // The engine may try to access this instance during its destruction. |
+ // Make sure this happens early while the instance is still intact. |
+ engine_.reset(); |
RemovePerInstanceObject(kPPPPdfInterface, this); |
} |