| 267 | //! but it requires much nastier integration with the intrusive pointer destruction routines. |
| 268 | template <typename T> |
| 269 | int ResetAndGetResidualRefCount(TIntrusivePtr<T>& pointer) |
| 270 | { |
| 271 | auto weakPointer = MakeWeak(pointer); |
| 272 | pointer.Reset(); |
| 273 | pointer = weakPointer.Lock(); |
| 274 | if (pointer) { |
| 275 | // This _may_ return 0 if we are again the only holder of the pointee. |
| 276 | return pointer->GetRefCount() - 1; |
| 277 | } else { |
| 278 | return 0; |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | //////////////////////////////////////////////////////////////////////////////// |
| 283 |
nothing calls this directly
no test coverage detected