changeset 33293:00a8d85deb92

Move m_config_free last, otherwise mp_msg might stop working if options it uses are freed/reset.
author reimar
date Thu, 05 May 2011 16:50:38 +0000
parents 91464ba53528
children f753079e6b9b
files mplayer.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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);
 }