Remove one ref, if the ref_count hit zero, delete this object. Same as butil::intrusive_ptr (obj, false).reset(NULL)
| 47 | // Remove one ref, if the ref_count hit zero, delete this object. |
| 48 | // Same as butil::intrusive_ptr<T>(obj, false).reset(NULL) |
| 49 | void RemoveRefManually() { |
| 50 | if (_nref.fetch_sub(1, butil::memory_order_release) == 1) { |
| 51 | butil::atomic_thread_fence(butil::memory_order_acquire); |
| 52 | delete this; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | protected: |
| 57 | virtual ~SharedObject() { } |
no test coverage detected