WeakReference WeakReferenceOwner::GetRef() const { // If we hold the last reference to the Flag then create a new one. if (!HasRefs()) flag_ = new WeakReference::Flag(); return WeakReference(flag_.get()); }
WeakReference WeakReferenceOwner::GetRef() const { // We also want to reattach to the current thread if all previous references // have gone away. if(!HasRefs()) { flag_ = new WeakReference::Flag(); } return WeakReference(flag_); }