summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/plugin/npobject_stub.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/content/plugin/npobject_stub.cc b/content/plugin/npobject_stub.cc
index 34d631d..9b94385 100644
--- a/content/plugin/npobject_stub.cc
+++ b/content/plugin/npobject_stub.cc
@@ -116,9 +116,16 @@ void NPObjectStub::DeleteSoon(bool release_npobject) {
if (npobject_) {
channel_->RemoveMappingForNPObjectStub(route_id_, npobject_);
- if (release_npobject)
- WebBindings::releaseObject(npobject_);
+
+ // We need to NULL npobject_ prior to calling releaseObject() to avoid
+ // problems with re-entrancy. See http://crbug.com/94179#c17 for more
+ // details on how this can happen.
+ NPObject* npobject = npobject_;
npobject_ = NULL;
+
+ if (release_npobject)
+ WebBindings::releaseObject(npobject);
+
MessageLoop::current()->PostTask(
FROM_HERE,
NewRunnableFunction(