MCPcopy Create free account
hub / github.com/apache/brpc / GetRef

Method GetRef

src/butil/memory/weak_ptr.cc:42–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42WeakReference WeakReferenceOwner::GetRef() const {
43 // If we hold the last reference to the Flag then create a new one.
44 if (!HasRefs())
45 flag_ = new WeakReference::Flag();
46
47 return WeakReference(flag_.get());
48}
49
50void WeakReferenceOwner::Invalidate() {
51 if (flag_.get()) {

Callers 2

GetWeakPtrMethod · 0.80
AsWeakPtrMethod · 0.80

Calls 2

HasRefsFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected