summaryrefslogtreecommitdiffstats
path: root/mplayer.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2011-05-05 16:50:38 +0000
committerUoti Urpala <uau@mplayer2.org>2011-06-29 07:29:30 +0300
commitfec08a5e85c711d7d1b697f1ac61358dbdff5147 (patch)
tree2ff042030b9a3962cdc5aeb7de8eeda07f9b5d9c /mplayer.c
parent30e8f03f2dfa7c94d1f8d9d2948d33f4bbba8820 (diff)
downloadmpv-fec08a5e85c711d7d1b697f1ac61358dbdff5147.tar.bz2
mpv-fec08a5e85c711d7d1b697f1ac61358dbdff5147.tar.xz
core: move m_config_free() last before exit
Move the call to m_config_free() to be the last thing done before exiting, otherwise mp_msg() might stop working if options it uses are freed/reset. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33380 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'mplayer.c')
-rw-r--r--mplayer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mplayer.c b/mplayer.c
index 406148aa46..e65afe5b0f 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -747,11 +747,6 @@ void exit_player_with_rc(struct MPContext *mpctx, enum exit_reason how, int rc)
current_module="exit_player";
-// free mplayer config
- if(mpctx->mconfig)
- m_config_free(mpctx->mconfig);
- mpctx->mconfig = NULL;
-
if(mpctx->playtree_iter)
play_tree_iter_free(mpctx->playtree_iter);
mpctx->playtree_iter = NULL;
@@ -781,6 +776,12 @@ void exit_player_with_rc(struct MPContext *mpctx, enum exit_reason how, int rc)
}
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 (mpctx->mconfig)
+ m_config_free(mpctx->mconfig);
+ mpctx->mconfig = NULL;
+
exit(rc);
}