Author: cazfi
Date: Wed May 11 06:18:51 2016
New Revision: 32660

URL: http://svn.gna.org/viewcvs/freeciv?rev=32660&view=rev
Log:
Use g_free() instead of free() to free G_TYPE_STRING.

See bug #24647

Modified:
    branches/S2_5/client/gui-gtk-2.0/cma_fe.c
    branches/S2_5/client/gui-gtk-3.0/cma_fe.c

Modified: branches/S2_5/client/gui-gtk-2.0/cma_fe.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-gtk-2.0/cma_fe.c?rev=32660&r1=32659&r2=32660&view=diff
==============================================================================
--- branches/S2_5/client/gui-gtk-2.0/cma_fe.c   (original)
+++ branches/S2_5/client/gui-gtk-2.0/cma_fe.c   Wed May 11 06:18:51 2016
@@ -174,7 +174,7 @@
   Cell data function for cma dialog 
 **************************************************************************/
 static void cell_data_func(GtkTreeViewColumn *col, GtkCellRenderer *cell,
-                          GtkTreeModel *model, GtkTreeIter *it, gpointer data)
+                           GtkTreeModel *model, GtkTreeIter *it, gpointer data)
 {
   struct cma_dialog *pdialog = (struct cma_dialog *) data;
   char *s1;
@@ -188,7 +188,7 @@
     return;
   }
   path = gtk_tree_model_get_path(model, it);
-  i1 = gtk_tree_path_get_indices(path) [0];
+  i1 = gtk_tree_path_get_indices(path)[0];
   gtk_tree_path_free(path);
 
   cmafec_get_fe_parameter(pdialog->pcity, &param);
@@ -197,13 +197,13 @@
 
   if (!strcmp(s1, s2) && i1 == i2) {
     g_object_set(G_OBJECT(cell), "style", PANGO_STYLE_ITALIC,
-                "weight", PANGO_WEIGHT_BOLD, NULL);
+                 "weight", PANGO_WEIGHT_BOLD, NULL);
   } else {
     g_object_set(G_OBJECT(cell), "style", PANGO_STYLE_NORMAL,
-                "weight", PANGO_WEIGHT_NORMAL, NULL);
-  }
-
-  free(s1);
+                 "weight", PANGO_WEIGHT_NORMAL, NULL);
+  }
+
+  g_free(s1);
 }
 
 /**************************************************************************

Modified: branches/S2_5/client/gui-gtk-3.0/cma_fe.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-gtk-3.0/cma_fe.c?rev=32660&r1=32659&r2=32660&view=diff
==============================================================================
--- branches/S2_5/client/gui-gtk-3.0/cma_fe.c   (original)
+++ branches/S2_5/client/gui-gtk-3.0/cma_fe.c   Wed May 11 06:18:51 2016
@@ -174,7 +174,7 @@
   Cell data function for cma dialog 
 **************************************************************************/
 static void cell_data_func(GtkTreeViewColumn *col, GtkCellRenderer *cell,
-                          GtkTreeModel *model, GtkTreeIter *it, gpointer data)
+                           GtkTreeModel *model, GtkTreeIter *it, gpointer data)
 {
   struct cma_dialog *pdialog = (struct cma_dialog *) data;
   char *s1;
@@ -197,13 +197,13 @@
 
   if (!strcmp(s1, s2) && i1 == i2) {
     g_object_set(G_OBJECT(cell), "style", PANGO_STYLE_ITALIC,
-                "weight", PANGO_WEIGHT_BOLD, NULL);
+                 "weight", PANGO_WEIGHT_BOLD, NULL);
   } else {
     g_object_set(G_OBJECT(cell), "style", PANGO_STYLE_NORMAL,
-                "weight", PANGO_WEIGHT_NORMAL, NULL);
-  }
-
-  free(s1);
+                 "weight", PANGO_WEIGHT_NORMAL, NULL);
+  }
+
+  g_free(s1);
 }
 
 /**************************************************************************


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to