MultiTimer ran into asserts


#1

Hello, I hit asserts in juce_Timer at 190 and 231 while using MultiTimer and the code said to let you know.

Here is my callback


    void timerCallback(int timerID) override
    {
        DBG("Current time: " + String(Time::currentTimeMillis()));
        startTimer(1000 - (Time::currentTimeMillis() % 1000));
    }
 

Works fine if I switch to Timer instead. Found a couple threads where Jules mentioned that MultiTimer is a big hack anyway so maybe I will stay away from it (has this changed?).

Thanks!


#2

Surely that code wouldn't compile, as MultiTimer::startTimer takes two arguments?


#3

Sorry, line should have read

startTimer(0, 1000 - (Time::currentTimeMillis() % 1000));
 


#4

Well, to trigger those asserts you probably used a dangling pointer or some other kind of silliness. If you can provide a code snippet that reproduces the problem, let me know and I'll investigate..