| 41 | } |
| 42 | |
| 43 | bool refcount_obj::decrement() |
| 44 | { |
| 45 | if (__atomic_sub_fetch(&refcount_, 1, __ATOMIC_ACQ_REL) == 0) |
| 46 | { |
| 47 | /** |
| 48 | * First call to destroy() will delete the held object, |
| 49 | * so it doesn't matter what the weak_refcount_ is, |
| 50 | * but we added one and we need to remove it now. |
| 51 | */ |
| 52 | decrement_weak(); |
| 53 | |
| 54 | return true; |
| 55 | } |
| 56 | else |
| 57 | return false; |
| 58 | } |
| 59 | |
| 60 | bool refcount_obj::decrement_weak() |
| 61 | { |
no outgoing calls
no test coverage detected