Re: [AD] 4.9 shutdown bug |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: "Coordination of admins/developers of the game programming library Allegro" <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] 4.9 shutdown bug
- From: "Trent Gamblin" <trentg@xxxxxxxxxx>
- Date: Sun, 2 Dec 2007 06:29:26 -0700
On 12/1/07, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> _al_exit() calls al_set_current_display(NULL);
>
> void al_set_current_display(ALLEGRO_DISPLAY *display)
> {
> if (display)
> display->vt->set_current_display(display);
>
> if ((tls = tls_get()) == NULL)
> return;
> tls->current_display = display;
>
> al_set_target_bitmap(al_get_backbuffer());
> }
>
> But at the time al_get_backbuffer() is called, _al_current_display will
> be NULL so it crashes. It wasn't obvious to me how it's intended to
> work so I leave it to someone else :)
Changed to:
void al_set_current_display(ALLEGRO_DISPLAY *display)
{
if ((tls = tls_get()) == NULL)
return;
tls->current_display = display;
if (display) {
display->vt->set_current_display(display);
al_set_target_bitmap(al_get_backbuffer());
}
}