#25 glutTimerFunc() crash when closing window

closed
nobody
nuisance (37)
5
2003-12-12
2003-11-22
olivier renault
No

glutTimerFunc() crash when closing window (clicking
the "close window" icon).

timer function

//-----------------------------------------------------
---------------------
// Update simulation
//-----------------------------------------------------
---------------------
void Timer(int timer)
{
Render();

glutTimerFunc(timer, Timer,
1000/UPDATE_FPS);
}

Discussion

  • Nigel Stewart
    Nigel Stewart
    2003-11-24

    Logged In: YES
    user_id=338692

    It is worth trying FreeGLUT from CVS - there was some recent
    work to prevent windows from ever triggering events once
    they are closed.

    In this case it looks like your code is drawing directly,
    rather than requesting a draw via glutPostRedisplay().
    Changing this may resolve your crash without updating from CVS.

     
  • Richard Rauch
    Richard Rauch
    2003-12-06

    Logged In: YES
    user_id=854844

    Drawing from the timer callback should be legal, though.
    While it is *preferable* to do a glutPostRedisplay() rather
    than directly draw (I assume that Render() directly draws),
    changing that should not be required. (Just to emphasize a
    point.)

    However, I believe that, as Nigel said, this has been fixed.
    The fix was in early November (Nov. 6 or 7). Can we close
    this bug report?

     
  • John F. Fay
    John F. Fay
    2003-12-12

    • status: open --> closed
     
  • John F. Fay
    John F. Fay
    2003-12-12

    Logged In: YES
    user_id=70811

    If it has been fixed, let's mark it fixed. If it comes up again,
    we can open a new bug report.