[MPlayer-cvslog] r33352 - in trunk/gui: cfg.c cfg.h interface.c

ib subversion at mplayerhq.hu
Tue May 3 15:19:39 CEST 2011


Author: ib
Date: Tue May  3 15:19:39 2011
New Revision: 33352

Log:
Free config.

It isn't freed so far.

Modified:
   trunk/gui/cfg.c
   trunk/gui/cfg.h
   trunk/gui/interface.c

Modified: trunk/gui/cfg.c
==============================================================================
--- trunk/gui/cfg.c	Tue May  3 14:21:11 2011	(r33351)
+++ trunk/gui/cfg.c	Tue May  3 15:19:39 2011	(r33352)
@@ -28,7 +28,6 @@
 #include "libmpcodecs/vd.h"
 #include "libvo/video_out.h"
 #include "libvo/x11_common.h"
-#include "m_config.h"
 #include "m_option.h"
 #include "mixer.h"
 #include "mp_msg.h"
@@ -39,6 +38,8 @@
 #include "sub/font_load.h"
 #include "sub/sub.h"
 
+m_config_t *gui_conf;
+
 int gtkCacheOn;
 int gtkCacheSize = 2048;
 
@@ -96,8 +97,6 @@ int gui_main_pos_y = -3;
 int gui_sub_pos_x  = -3;
 int gui_sub_pos_y  = -3;
 
-static m_config_t *gui_conf;
-
 static const m_option_t gui_opts[] = {
     { "cache",                       &gtkCacheOn,              CONF_TYPE_FLAG,        0,          0,     1,       NULL },
     { "cache_size",                  &gtkCacheSize,            CONF_TYPE_INT,         CONF_RANGE, 32,    1048576, NULL },

Modified: trunk/gui/cfg.h
==============================================================================
--- trunk/gui/cfg.h	Tue May  3 14:21:11 2011	(r33351)
+++ trunk/gui/cfg.h	Tue May  3 15:19:39 2011	(r33352)
@@ -19,6 +19,10 @@
 #ifndef MPLAYER_GUI_CFG_H
 #define MPLAYER_GUI_CFG_H
 
+#include "m_config.h"
+
+extern m_config_t *gui_conf;
+
 extern int gtkCacheOn;
 extern int gtkCacheSize;
 

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Tue May  3 14:21:11 2011	(r33351)
+++ trunk/gui/interface.c	Tue May  3 15:19:39 2011	(r33352)
@@ -72,6 +72,8 @@ char *fsHistory[fsPersistant_MaxPos] = {
 
 float gtkEquChannels[6][10];
 
+static int initialized;
+
 int gstrcmp(const char *a, const char *b)
 {
     if (!a && !b)
@@ -379,6 +381,8 @@ void guiInit(void)
         guiSetFilename(guiIntfStruct.Subtitlename, subdata->filename);
 
     guiLoadFont();
+
+    initialized = 1;
 }
 
 void guiDone(void)
@@ -417,6 +421,13 @@ void guiDone(void)
 // GUI's own abortions during (and before) guiInit().
 void guiExit(int how)
 {
+    if (!initialized || (how == DONE)) {
+        if (gui_conf) {
+            m_config_free(gui_conf);
+            gui_conf = NULL;
+        }
+    }
+
     if (how != DONE)
         exit_player(how);
 }


More information about the MPlayer-cvslog mailing list