diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-12 00:41:19 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-12 00:41:19 +0000 |
commit | fba17e47e25fa099c80d324cde30669169510175 (patch) | |
tree | b9f4983865e2e23acee5279e6ac0e00cdeeba578 /ppapi | |
parent | 841243fd0ad7a97186b36901c74816c154f643e3 (diff) | |
download | chromium_src-fba17e47e25fa099c80d324cde30669169510175.zip chromium_src-fba17e47e25fa099c80d324cde30669169510175.tar.gz chromium_src-fba17e47e25fa099c80d324cde30669169510175.tar.bz2 |
Fix self-assignment in pp::Resource
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6212003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71123 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/cpp/resource.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ppapi/cpp/resource.cc b/ppapi/cpp/resource.cc index 7daab4a..5a327d6 100644 --- a/ppapi/cpp/resource.cc +++ b/ppapi/cpp/resource.cc @@ -25,11 +25,11 @@ Resource::~Resource() { } Resource& Resource::operator=(const Resource& other) { + if (!other.is_null()) + Module::Get()->core()->AddRefResource(other.pp_resource_); if (!is_null()) Module::Get()->core()->ReleaseResource(pp_resource_); pp_resource_ = other.pp_resource_; - if (!is_null()) - Module::Get()->core()->AddRefResource(pp_resource_); return *this; } |