pspp-cvs
[Top][All Lists]
Advanced

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

[Pspp-cvs] pspp/src/ui/gui dialog-common.c helper.c recode...


From: John Darrington
Subject: [Pspp-cvs] pspp/src/ui/gui dialog-common.c helper.c recode...
Date: Sun, 03 Feb 2008 05:26:05 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Changes by:     John Darrington <jmd>   08/02/03 05:26:05

Modified files:
        src/ui/gui     : dialog-common.c helper.c recode-dialog.c 

Log message:
        Fix memory leaks in gui

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/dialog-common.c?cvsroot=pspp&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/helper.c?cvsroot=pspp&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/recode-dialog.c?cvsroot=pspp&r1=1.2&r2=1.3

Patches:
Index: dialog-common.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/dialog-common.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- dialog-common.c     3 Feb 2008 04:15:34 -0000       1.8
+++ dialog-common.c     3 Feb 2008 05:26:05 -0000       1.9
@@ -193,16 +193,15 @@
   for (l = list; l ; l = l->next)
     {
       GtkTreePath *path = l->data;
-      GtkTreePath *fpath;
-      gint *idx;
 
-      const struct variable *v;
+      GtkTreePath *fpath =
+       gtk_tree_model_filter_convert_path_to_child_path (GTK_TREE_MODEL_FILTER 
(model), path);
 
-      fpath = gtk_tree_model_filter_convert_path_to_child_path 
(GTK_TREE_MODEL_FILTER (model), path);
+      gint *idx = gtk_tree_path_get_indices (fpath);
 
-      idx = gtk_tree_path_get_indices (fpath);
+      const struct variable *v = psppire_dict_get_variable (dict, idx[0]);
 
-      v = psppire_dict_get_variable (dict, idx[0]);
+      gtk_tree_path_free (fpath);
 
       if ( type != -1 )
        {

Index: helper.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/helper.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- helper.c    23 Nov 2007 10:34:54 -0000      1.30
+++ helper.c    3 Feb 2008 05:26:05 -0000       1.31
@@ -336,6 +336,8 @@
       row++;
     }
 
+  g_free (types);
+
   return dest;
 }
 

Index: recode-dialog.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/recode-dialog.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- recode-dialog.c     29 Jan 2008 11:13:00 -0000      1.2
+++ recode-dialog.c     3 Feb 2008 05:26:05 -0000       1.3
@@ -326,7 +326,6 @@
   GtkWidget *ov_high_down_entry;
 
   GtkListStore *value_map;
-  GtkListStore *local_store;
 
   /* Indicates that the INTO {new variables} form of the dialog
      is being used */
@@ -1110,6 +1109,10 @@
       break;
     }
 
+
+  gtk_list_store_clear (GTK_LIST_STORE (rd.value_map));
+  g_object_unref (rd.value_map);
+
   g_object_unref (xml);
 }
 
@@ -1263,11 +1266,9 @@
 run_old_and_new_dialog (struct recode_dialog *rd)
 {
   gint response;
-  rd->local_store = clone_list_store (rd->value_map);
-
-  g_object_ref (rd->local_store);
+  GtkListStore *local_store = clone_list_store (rd->value_map);
 
-  psppire_acr_set_model (rd->acr, rd->local_store);
+  psppire_acr_set_model (rd->acr, local_store);
   psppire_acr_set_get_value_func (rd->acr, set_value, rd);
 
   gtk_window_set_title (GTK_WINDOW (rd->old_and_new_dialog),
@@ -1316,7 +1317,12 @@
 
 
   if ( response == PSPPIRE_RESPONSE_CONTINUE )
-      rd->value_map = clone_list_store (rd->local_store);
+    {
+      g_object_unref (rd->value_map);
+      rd->value_map = clone_list_store (local_store);
+    }
+  else
+    g_object_unref (local_store);
 
 
   psppire_dialog_notify_change (PSPPIRE_DIALOG (rd->dialog));




reply via email to

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