Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Unified Diff: ppapi/cpp/resource.cc

Issue 6212003: Fix self-assignment in pp::Resource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/resource.cc
diff --git a/ppapi/cpp/resource.cc b/ppapi/cpp/resource.cc
index 7daab4a4a52e60e42e4af849af84ea33b22c1fff..5a327d635937daabb1c46d90a5108bdc2f37df04 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698