diff options
author | dmichael@google.com <dmichael@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-29 19:01:12 +0000 |
---|---|---|
committer | dmichael@google.com <dmichael@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-29 19:01:12 +0000 |
commit | cd90f04a98cb13a76f5c943eefa2cae6ebbf4b21 (patch) | |
tree | c28129fa0e06e70ca62307e52f4da99bebb8fad8 /webkit/plugins/ppapi/plugin_object.cc | |
parent | 0f64c1daccfc82eab19ad7ed1fb9d5a381ac8875 (diff) | |
download | chromium_src-cd90f04a98cb13a76f5c943eefa2cae6ebbf4b21.zip chromium_src-cd90f04a98cb13a76f5c943eefa2cae6ebbf4b21.tar.gz chromium_src-cd90f04a98cb13a76f5c943eefa2cae6ebbf4b21.tar.bz2 |
Fix up some reference counting when WebPluginImpl::scriptableObject is called.
BUG= http://code.google.com/p/chromium-os/issues/detail?id=13605
TEST=none
Review URL: http://codereview.chromium.org/6731051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79712 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/plugin_object.cc')
-rw-r--r-- | webkit/plugins/ppapi/plugin_object.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/webkit/plugins/ppapi/plugin_object.cc b/webkit/plugins/ppapi/plugin_object.cc index d99ef80..d5b9865 100644 --- a/webkit/plugins/ppapi/plugin_object.cc +++ b/webkit/plugins/ppapi/plugin_object.cc @@ -290,7 +290,14 @@ PP_Var PluginObject::Create(PluginInstance* instance, // We can just use a normal ObjectVar to refer to this object from the // plugin. It will hold a ref to the underlying NPObject which will in turn // hold our pluginObject. - return ObjectVar::NPObjectToPPVar(instance, wrapper); + PP_Var obj_var(ObjectVar::NPObjectToPPVar(instance, wrapper)); + + // Note that the ObjectVar constructor incremented the reference count, and so + // did WebBindings::createObject above. Now that the PP_Var has taken + // ownership, we need to release to balance out the createObject reference + // count bump. + WebBindings::releaseObject(wrapper); + return obj_var; } NPObject* PluginObject::GetNPObject() const { |