MCPcopy Create free account
hub / github.com/defold/defold / CancelTimer

Function CancelTimer

engine/script/src/script_timer.cpp:339–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337 }
338
339 bool CancelTimer(HTimerWorld timer_world, HTimer handle)
340 {
341 Timer* timer = GetTimerFromHandle(timer_world, handle);
342 if (!timer)
343 {
344 return false;
345 }
346 if (timer->m_IsAlive == 0)
347 {
348 return false;
349 }
350
351 timer->m_IsAlive = 0;
352 timer->m_Callback(timer_world, TIMER_EVENT_CANCELLED, timer->m_Handle, 0.f, timer->m_Owner, timer->m_UserData);
353
354 if (timer_world->m_InUpdate == 0)
355 {
356 FreeTimer(timer_world, timer);
357 ++timer_world->m_Version;
358 }
359
360 return true;
361 }
362
363 uint32_t KillTimers(HTimerWorld timer_world, uintptr_t owner)
364 {

Callers 3

TimerCancelFunction · 0.85
TEST_FFunction · 0.85
cbMethod · 0.85

Calls 2

GetTimerFromHandleFunction · 0.85
FreeTimerFunction · 0.85

Tested by 2

TEST_FFunction · 0.68
cbMethod · 0.68