Hello,
I’m trying to fix a bug I found in my code, its actually pretty weird.
I cant reproduce the behavior in a sample as I get it only in my complex environment now.
I would like to ask: what kind of lua code can cause a timer from not executing its onComplete function?
print(system.getTimer(), "beforeTimer") timer.performWithDelay(1, function() print(system.getTimer(), "afterTimer") end)
This is a simple example of the code I execute, you would expect the afterTimer should always get executed, but it is not… Somehow some other code in my projects stops it I think, because it only happens when I button bash my analog stick in the game to walk the player around.
The output I get is the following:
10494.218 beforeTimer
10510.503 afterTimer
10776.975 beforeTimer
10794.729 afterTimer
11045.712 beforeTimer
11062.548 afterTimer
11376.585 beforeTimer
11393.385 afterTimer
11668.887 beforeTimer
11685.302 afterTimer
12213.489 beforeTimer
It stops at beforeTimer, but it never executes the afterTimer print after that. I do not cancel any timers in my code, and when I attach a runtimeListener on creation that prints the timer, it shows me the timer stays in memory (without any _paused or _cancelled state), the function is just not executed.
What can cause this to happen? Too much load on CPU?
PS. The bug does not occur on my iPhone device, only in simulator