MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / OnEnd

Method OnEnd

Source/Engine/Threading/Task.cpp:224–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224void 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}

Callers

nothing calls this directly

Calls 2

DeleteObjectMethod · 0.80
IsRunningFunction · 0.70

Tested by

no test coverage detected