fix linux crash when timers enabled: clear timer while taking down board

This commit is contained in:
Eric House 2013-12-01 18:50:18 -08:00
parent fc6d6ec707
commit 9fa9ba643f

View file

@ -99,6 +99,8 @@ static void invalTradeWindow( BoardCtxt* board, XP_S16 turn, XP_Bool redraw );
static XP_Bool invalCellsWithTiles( BoardCtxt* board );
static void setTimerIf( BoardCtxt* board );
static void clearTimerIf( const BoardCtxt* board );
static XP_Bool p_board_timerFired( void* closure, XWTimerReason why );
static XP_Bool replaceLastTile( BoardCtxt* board );
@ -193,6 +195,7 @@ board_make( MPFORMAL ModelCtxt* model, ServerCtxt* server, DrawCtx* draw,
void
board_destroy( BoardCtxt* board )
{
clearTimerIf( board );
XP_FREE( board->mpool, board );
} /* board_destroy */
@ -1234,6 +1237,12 @@ setTimerIf( BoardCtxt* board )
}
} /* setTimerIf */
static void
clearTimerIf( const BoardCtxt* board )
{
util_clearTimer( board->util, TIMER_TIMERTICK );
}
static void
timerFiredForTimer( BoardCtxt* board )
{