cleanup -- no logic change

This commit is contained in:
Eric House 2014-03-08 20:51:49 -08:00
parent e0c17c50b3
commit 8a6adfec34

View file

@ -785,26 +785,27 @@ destroy_board_window( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
static void static void
cleanup( GtkGameGlobals* globals ) cleanup( GtkGameGlobals* globals )
{ {
saveGame( &globals->cGlobals ); CommonGlobals* cGlobals = &globals->cGlobals;
saveGame( cGlobals );
g_source_remove( globals->idleID ); g_source_remove( globals->idleID );
#ifdef XWFEATURE_BLUETOOTH #ifdef XWFEATURE_BLUETOOTH
linux_bt_close( &globals->cGlobals ); linux_bt_close( cGlobals );
#endif #endif
#ifdef XWFEATURE_SMS #ifdef XWFEATURE_SMS
// linux_sms_close( &globals->cGlobals ); // linux_sms_close( cGlobals );
#endif #endif
#ifdef XWFEATURE_IP_DIRECT #ifdef XWFEATURE_IP_DIRECT
linux_udp_close( &globals->cGlobals ); linux_udp_close( cGlobals );
#endif #endif
#ifdef XWFEATURE_RELAY #ifdef XWFEATURE_RELAY
linux_close_socket( &globals->cGlobals ); linux_close_socket( cGlobals );
#endif #endif
game_dispose( &globals->cGlobals.game ); /* takes care of the dict */ game_dispose( &cGlobals->game ); /* takes care of the dict */
gi_disposePlayerInfo( MEMPOOL globals->cGlobals.gi ); gi_disposePlayerInfo( MEMPOOL cGlobals->gi );
linux_util_vt_destroy( globals->cGlobals.util ); linux_util_vt_destroy( cGlobals->util );
free( globals->cGlobals.util ); free( cGlobals->util );
} /* cleanup */ } /* cleanup */
GtkWidget* GtkWidget*
@ -827,14 +828,15 @@ makeAddSubmenu( GtkWidget* menubar, gchar* label )
static void static void
tile_values( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals ) tile_values( GtkWidget* XP_UNUSED(widget), GtkGameGlobals* globals )
{ {
if ( !!globals->cGlobals.game.server ) { CommonGlobals* cGlobals = &globals->cGlobals;
if ( !!cGlobals->game.server ) {
XWStreamCtxt* stream = XWStreamCtxt* stream =
mem_stream_make( MEMPOOL mem_stream_make( MEMPOOL
globals->cGlobals.params->vtMgr, cGlobals->params->vtMgr,
globals, globals,
CHANNEL_NONE, CHANNEL_NONE,
catOnClose ); catOnClose );
server_formatDictCounts( globals->cGlobals.game.server, stream, 5 ); server_formatDictCounts( cGlobals->game.server, stream, 5 );
stream_putU8( stream, '\n' ); stream_putU8( stream, '\n' );
stream_destroy( stream ); stream_destroy( stream );
} }