Decrements the reference count and returns the new value. * * When the reference count reaches 0, the object is deleted. */
| 34 | * When the reference count reaches 0, the object is deleted. |
| 35 | */ |
| 36 | int DecRef() noexcept { |
| 37 | int ret = std::atomic_fetch_sub_explicit(&ref_, 1, std::memory_order_acq_rel) - 1; |
| 38 | if (!ret) |
| 39 | delete this; |
| 40 | return ret; |
| 41 | } |
| 42 | |
| 43 | /** Returns the current reference count. */ |
| 44 | int RefCount() const noexcept { |
no outgoing calls
no test coverage detected