Clarify documentation on scoped_refptr::release.
NOTRY=True Bug: None Change-Id: I063ea848eb79dfa3d14817c28c582cd5399e711b Reviewed-on: https://webrtc-review.googlesource.com/63620 Commit-Queue: Niels Moller <nisse@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22551}
This commit is contained in:
parent
7aabd39b4b
commit
82cea033be
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user