From a9542869605e0dee9429f25c7ab5f73c3b2ba0b8 Mon Sep 17 00:00:00 2001 From: ehouse Date: Tue, 30 Jun 2009 12:55:47 +0000 Subject: [PATCH] avoid mempool assertions by cleaning up on way out --- xwords4/linux/cursesmain.c | 3 +++ xwords4/linux/linuxmain.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xwords4/linux/cursesmain.c b/xwords4/linux/cursesmain.c index e31430e6f..f6bc613af 100644 --- a/xwords4/linux/cursesmain.c +++ b/xwords4/linux/cursesmain.c @@ -1485,6 +1485,9 @@ cursesmain( XP_Bool isServer, LaunchParams* params ) } } } + + game_dispose( &g_globals.cGlobals.game ); /* takes care of the dict */ + gi_disposePlayerInfo( MEMPOOL &g_globals.cGlobals.params->gi ); #ifdef XWFEATURE_BLUETOOTH linux_bt_close( &g_globals.cGlobals ); diff --git a/xwords4/linux/linuxmain.c b/xwords4/linux/linuxmain.c index 0076b9459..2052311cb 100644 --- a/xwords4/linux/linuxmain.c +++ b/xwords4/linux/linuxmain.c @@ -731,8 +731,6 @@ main( int argc, char** argv ) useCurses = XP_TRUE; #endif - - do { short index; opt = getopt( argc, argv, "?" @@ -1055,6 +1053,8 @@ main( int argc, char** argv ) usage( argv[0], "rtfm" ); } + vtmgr_destroy( MPPARM(mainParams.util->mpool) mainParams.vtMgr ); + linux_util_vt_destroy( mainParams.util ); mpool_destroy( mainParams.util->mpool );