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

Unified Diff: base/memory/ref_counted.h

Issue 11458003: Remove scoped_refptr::release which is confusing and causes leaks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: just remove scoped_refptr::release Created 8 years 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: base/memory/ref_counted.h
diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h
index 98dce1d719e84361b8ca44fd3684ca92cd9e080e..0c6a71fdb3e7abd62669d13bd8617bdc0a5412ad 100644
--- a/base/memory/ref_counted.h
+++ b/base/memory/ref_counted.h
@@ -257,17 +257,6 @@ class scoped_refptr {
return ptr_;
}
- // Release a pointer.
- // The return value is the current pointer held by this object.
- // If this object holds a NULL pointer, the return value is NULL.
- // After this operation, this object will hold a NULL pointer,
- // and will not own the object any more.
- T* release() WARN_UNUSED_RESULT {
- T* retVal = ptr_;
- ptr_ = NULL;
- return retVal;
- }
-
scoped_refptr<T>& operator=(T* p) {
// AddRef first so that self assignment should work
if (p)
« 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