Destroy the given MultiCallbackHolder, freeing it if it is not firstHolder.
| 157 | |
| 158 | // Destroy the given MultiCallbackHolder, freeing it if it is not firstHolder. |
| 159 | void destroyHolder(MultiCallbackHolder* h) { |
| 160 | UNSTOPPABLE_ASSERT(h != nullptr); |
| 161 | |
| 162 | // If h is the firstHolder just clear its holder pointer to indicate unusedness |
| 163 | if (h == &firstHolder) { |
| 164 | h->multiCallback = nullptr; |
| 165 | } else { |
| 166 | // Otherwise unlink h from the doubly linked list and free it |
| 167 | // h->previous is definitely valid |
| 168 | h->previous->next = h->next; |
| 169 | if (h->next) { |
| 170 | h->next->previous = h->previous; |
| 171 | } |
| 172 | delete h; |
| 173 | } |
| 174 | } |
| 175 | }; |
| 176 | |
| 177 | class ThreadMultiCallback final : public ThreadCallback, public FastAllocated<ThreadMultiCallback> { |
no outgoing calls
no test coverage detected