Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#5 program simple_red_box crashes on exit

closed-fixed
Paul Cohen
None
9
2002-01-19
2002-01-19
Paul Cohen
No

When I run the EGL/WEL example program "simple_red_box" and want to close
the window, I click on the "cross" icon on the right top of the window, I get
an precondition violation in OPENGL_RENDERING_CONTEXT "delete" (is_current).

Explanation: The MAIN_WINDOW class of the program was buggy:
1. It redefined "on_wm_destroy" instead of "on_destroy" and also contained a
call to "destroy" which caused recursive invocation of "on_wm_destroy".
2. It did a "make_current" on an already current OPENGL_RENDERING_CONTEXT.

Solution:
1. Ensure that it is the feature "on_destroy" that is redefined.
2. Do not call destroy (the window is already being destroyed!).
3. Do not call "make current" on an already current OPENGL_RENDERING_CONTEXT.
This example program only runs one thread and there is no reason to set
the OPENGL_RENDERING_CONTEXT to current after this is done in the initial
call to "on_show". The feature "make_current" now has a precondition stating
that it can't already be current when a call to "make_current" is done.

Discussion

  • Paul Cohen
    Paul Cohen
    2002-01-19

    • assigned_to: nobody --> paco
    • status: open --> closed-fixed
     
  • Paul Cohen
    Paul Cohen
    2002-01-19

    • summary: program simple_red_box crasches on exit --> program simple_red_box crashes on exit