diff --git a/rtc_base/scoped_ref_ptr.h b/rtc_base/scoped_ref_ptr.h index 0f4698a256..8fefc73031 100644 --- a/rtc_base/scoped_ref_ptr.h +++ b/rtc_base/scoped_ref_ptr.h @@ -103,11 +103,11 @@ class scoped_refptr { operator T*() const { return ptr_; } T* operator->() const { 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. + // Returns the (possibly null) raw pointer, and makes the scoped_refptr hold a + // null pointer, all without touching the reference count of the underlying + // pointed-to object. The object is still reference counted, and the caller of + // release() is now the proud owner of one reference, so it is responsible for + // calling Release() once on the object when no longer using it. T* release() { T* retVal = ptr_; ptr_ = nullptr;