diff mplayer.c @ 33307:552f1f7731c8

Set GUI initialization flag earlier. So far, the flag is set after the call of guiInit(), but there are calls to GUI functions (like reading the GUI config) before that. As MPlayer (when exiting) only calls GUI's cleanup function guiDone() if the flag is set, it neglects calling guiDone() on any error between the first GUI function call and execution of guiInit(). Now the flag is set before the first GUI function call. As a result, GUI's own exit function (also used for fatal GUI errors, and thus also for errors occurring before guiInit() properly finishes) doesn't have to handle cleanup any longer. The code can be moved to guiDone().
author ib
date Sat, 07 May 2011 15:30:14 +0000
parents 00a8d85deb92
children 02021152bad3
line wrap: on
line diff
--- a/mplayer.c	Sat May 07 11:11:07 2011 +0000
+++ b/mplayer.c	Sat May 07 15:30:14 2011 +0000
@@ -2757,7 +2757,10 @@
     parse_cfgfiles(mconfig);
 
 #ifdef CONFIG_GUI
-    if ( use_gui ) cfg_read();
+    if ( use_gui ) {
+      initialized_flags|=INITIALIZED_GUI;
+      cfg_read();
+    }
 #endif
 
     mpctx->playtree = m_config_parse_mp_command_line(mconfig, argc, argv);
@@ -3018,7 +3021,6 @@
   if(use_gui){
        guiInit();
        guiGetEvent(guiSetContext, mpctx);
-       initialized_flags|=INITIALIZED_GUI;
        guiGetEvent( guiCEvent,(char *)((gui_no_filename) ? 0 : 1) );
   }
 #endif