- refcount_--;
- if (not refcount_) {
- if (stateSetHook_.is_linked())
- simgrid::xbt::intrusive_erase(*getStateSet(), *this);
- /* remove from action_set */
- if (action_ti_hook.is_linked())
- simgrid::xbt::intrusive_erase(cpu_->actionSet_, *this);
- /* remove from heap */
- heapRemove(getModel()->getActionHeap());
- cpu_->modified(true);
- delete this;
- return 1;
- }
- return 0;