I am making a TRON Game using Allegro, and in my game loop I have the following code:
al_start_timer(game->timer);
while(1) {
al_wait_for_event(game->timer_queue, &evt);
if(evt.type == ALLEGRO_EVENT_TIMER) ++timer;
if (!al_is_event_queue_empty(game->timer_queue)) continue;
while(timer > 0) {
--timer;
process_keyboard_input(game);
if(game->should_abort) {
//program stops here
al_destroy_timer(game->timer);
return; //exits the game loop function and ends the game
}
// Colision checking
}
}
And then, below that code I have some colision testing that enables game->should_abort
. But with some printfs I have discoreved that the program runs until al_destroy_timer(game->timer)
is called. Is it possible the execution stopped because of some thread violation?