Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return 1 after timer_add(...) breaks modules #55

Open
cyriax0 opened this issue Jul 18, 2018 · 0 comments
Open

return 1 after timer_add(...) breaks modules #55

cyriax0 opened this issue Jul 18, 2018 · 0 comments
Labels
bug Bugs or misbehaviour.

Comments

@cyriax0
Copy link
Contributor

cyriax0 commented Jul 18, 2018

Reproducing:

In an gfx_* module (e.g. gfx_rainbow)

int draw(int argc, char* argv[]) {
    [...]
    frame++;
    nexttick += FRAMETIME;
    timer_add(nexttick, modno, 0, NULL);
    if (frame > 100) return 1;
    return 0;
}

What happens

After returning 1 modules the timers are broken and modules start a switch loop in which the last two modules are switched rapidly without waiting for timers or fininshing. The output is erratic. No modules run normally.

Possible solutions

clear timer for that module after a module returns 1

@vifino vifino added the bug Bugs or misbehaviour. label Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugs or misbehaviour.
Projects
None yet
Development

No branches or pull requests

2 participants