gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3387 - in GNUnet: . src/setup src/setup/gtk src/setup/lib


From: grothoff
Subject: [GNUnet-SVN] r3387 - in GNUnet: . src/setup src/setup/gtk src/setup/lib src/util/config_impl
Date: Sun, 10 Sep 2006 17:15:17 -0700 (PDT)

Author: grothoff
Date: 2006-09-10 17:15:12 -0700 (Sun, 10 Sep 2006)
New Revision: 3387

Modified:
   GNUnet/src/setup/Makefile.am
   GNUnet/src/setup/gtk/gconf.c
   GNUnet/src/setup/lib/tree.c
   GNUnet/src/util/config_impl/impl.c
   GNUnet/todo
Log:
fixing leaks and related issues

Modified: GNUnet/src/setup/Makefile.am
===================================================================
--- GNUnet/src/setup/Makefile.am        2006-09-10 23:47:10 UTC (rev 3386)
+++ GNUnet/src/setup/Makefile.am        2006-09-11 00:15:12 UTC (rev 3387)
@@ -11,8 +11,7 @@
  textdir=text
 endif
 
-SUBDIRS = lib $(textdir) . $(curses_dir)
-# $(gtk_dir) .
+SUBDIRS = lib $(textdir) . $(curses_dir) $(gtk_dir) .
 
 plugindir = $(libdir)/GNUnet
 

Modified: GNUnet/src/setup/gtk/gconf.c
===================================================================
--- GNUnet/src/setup/gtk/gconf.c        2006-09-10 23:47:10 UTC (rev 3386)
+++ GNUnet/src/setup/gtk/gconf.c        2006-09-11 00:15:12 UTC (rev 3387)
@@ -295,6 +295,7 @@
   /* update model */
   gtk_tree_view_set_model(GTK_TREE_VIEW(treeView),
                          GTK_TREE_MODEL(model));
+  g_object_unref(model);
   /* restore expanded paths */
   for (i=0;i<crCTX.size;i++) {
     path = gtk_tree_path_new_from_string(crCTX.paths[i]);
@@ -318,8 +319,8 @@
   GtkTreeIter iter;
   GtkWidget * treeView;
   GtkTreeModel * model;
-  const char * section;
-  const char * option;
+  char * section;
+  char * option;
 
   treeView = lookup_widget("configTreeView");
   model = gtk_tree_view_get_model(GTK_TREE_VIEW(treeView));
@@ -328,26 +329,23 @@
                                      &iter,
                                      gtk_path)) {
     GE_BREAK(ectx, 0);
+    gtk_tree_path_free(gtk_path);
     return;
   }
+  gtk_tree_path_free(gtk_path);
   gtk_tree_model_get(model,
                     &iter,
                     SETUP_SECTION, &section,
                     SETUP_OPTION, &option,
                     -1);
-  if (0 != GC_set_configuration_value_string(cfg,
-                                            ectx,
-                                            section,
-                                            option,
-                                            new_value)) {
-    GE_LOG(ectx,
-          GE_WARNING | GE_USER | GE_IMMEDIATE,
-          _("Failed to change configuration option `%s' in section `%s' to 
value `%s'.\n"),
-          option,
-          section,
-          new_value);
-  }
+  GC_set_configuration_value_string(cfg,
+                                   ectx,
+                                   section,
+                                   option,
+                                   new_value);
   updateTreeModel(gns);
+  free(section);
+  free(option);
 }
 
 static void initTreeView(struct GNS_Context * gns) {

Modified: GNUnet/src/setup/lib/tree.c
===================================================================
--- GNUnet/src/setup/lib/tree.c 2006-09-10 23:47:10 UTC (rev 3386)
+++ GNUnet/src/setup/lib/tree.c 2006-09-11 00:15:12 UTC (rev 3387)
@@ -182,6 +182,10 @@
            opt,
            sec);
   }
+  if (sec != NULL)
+    free(sec);
+  if (opt != NULL)
+    free(opt);
   return SCM_EOL;
 }
 

Modified: GNUnet/src/util/config_impl/impl.c
===================================================================
--- GNUnet/src/util/config_impl/impl.c  2006-09-10 23:47:10 UTC (rev 3386)
+++ GNUnet/src/util/config_impl/impl.c  2006-09-11 00:15:12 UTC (rev 3387)
@@ -103,7 +103,7 @@
   struct GE_Context * ectx;
 
   /**
-   * Modification indication since last save.
+   * Modification indication since last save
    * 0 if clean, 1 if dirty, -1 on error (i.e. last save failed)
    */
   int dirty;
@@ -317,12 +317,14 @@
       e = &sec->entries[j];
       GE_ASSERT(data->ectx,
                e->dirty_val == NULL);
-      if (0 > fprintf(fp,
-                     "%s = %s\n",
-                     e->key,
-                     e->val)) {
-       error = 1;
-       break;
+      if (e->val != NULL) {
+       if (0 > fprintf(fp,
+                       "%s = %s\n",
+                       e->key,
+                       e->val)) {
+         error = 1;
+         break;
+       }
       }
     }
     if (error != 0)

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-09-10 23:47:10 UTC (rev 3386)
+++ GNUnet/todo 2006-09-11 00:15:12 UTC (rev 3387)
@@ -55,8 +55,6 @@
       - dht
       - testbed
   * setup:
-    + gtk config
-      - memory leaks
     + gtk wizard
     + ncurses wizard
     + Scheme (scm) specification of entire configuration





reply via email to

[Prev in Thread] Current Thread [Next in Thread]