[AD] ex_winfull crash on exit [OS X]

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I just found ex_winfull crashes on OS X when the windows are destroyed at the end. The cause is the backup and restoration of the "current" display at the end of destroy_display(). The sequence of events is:

1. The current display is the windowed display (win).
2. The windowed display (current display) is destroyed.
3. The fullscreen display is destroyed.

When the display is destroyed, the display is made current (to make the OpenGL context current), however, when the fullscreen display is destroyed, the (now non-existent) windowed display is set as current. This means that when it tries to restore the "current" display at the end of the function al_set_current_display() crashes. Setting the fullscreen window as the "current" display prior to calling destroy_display() fixes the crash.

Now, my question is: what should al_get_current_display() return if the previous current display was destroyed? NULL?

Evert




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/