From 9fa9ba643f164054e08d6abfc64ffd314fc089e7 Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 1 Dec 2013 18:50:18 -0800 Subject: [PATCH] fix linux crash when timers enabled: clear timer while taking down board --- xwords4/common/board.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xwords4/common/board.c b/xwords4/common/board.c index 93f6272e5..f40984bbd 100644 --- a/xwords4/common/board.c +++ b/xwords4/common/board.c @@ -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 ) {