| 222 | } |
| 223 | |
| 224 | void Task::OnEnd() |
| 225 | { |
| 226 | ASSERT(!IsRunning()); |
| 227 | |
| 228 | if (_continueWith && !_continueWith->IsEnded()) |
| 229 | { |
| 230 | // Let next task do the cleanup (to ensure whole tasks chain shares the lifetime) |
| 231 | _continueWith->_rootForRemoval = _rootForRemoval ? _rootForRemoval : this; |
| 232 | } |
| 233 | else |
| 234 | { |
| 235 | constexpr float timeToLive = 30.0f; |
| 236 | |
| 237 | // Remove task chain starting from the root |
| 238 | if (_rootForRemoval) |
| 239 | { |
| 240 | auto task = _rootForRemoval; |
| 241 | while (task != this) |
| 242 | { |
| 243 | task->DeleteObject(timeToLive, false); |
| 244 | task = task->_continueWith; |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | // Add to delete |
| 249 | DeleteObject(timeToLive, false); |
| 250 | } |
| 251 | } |
nothing calls this directly
no test coverage detected