# HG changeset patch # User reimar # Date 1304614238 0 # Node ID 00a8d85deb928a999ef06831c5e6754be08817a2 # Parent 91464ba53528986ad311b0ef87cecb18ca2870e5 Move m_config_free last, otherwise mp_msg might stop working if options it uses are freed/reset. diff -r 91464ba53528 -r 00a8d85deb92 mplayer.c --- a/mplayer.c Thu May 05 15:54:35 2011 +0000 +++ b/mplayer.c Thu May 05 16:50:38 2011 +0000 @@ -729,11 +729,6 @@ current_module="exit_player"; -// free mplayer config - if(mconfig) - m_config_free(mconfig); - mconfig = NULL; - if(mpctx->playtree_iter) play_tree_iter_free(mpctx->playtree_iter); mpctx->playtree_iter = NULL; @@ -762,6 +757,12 @@ } mp_msg(MSGT_CPLAYER,MSGL_DBG2,"max framesize was %d bytes\n",max_framesize); + // must be last since e.g. mp_msg uses option values + // that will be freed by this. + if(mconfig) + m_config_free(mconfig); + mconfig = NULL; + exit(rc); }