[glade/offscreen-design-layout] * gladeui/glade-palette.c: Dont strdup the adaptor names in the local hash table (those strings



commit bcec5a0217666be1706f0e086abade549cd0eeea
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Fri Jan 21 17:49:19 2011 +0900

    	* gladeui/glade-palette.c: Dont strdup the adaptor names in the local hash table (those
    	  strings are constant data, no need to dup them).

 ChangeLog               |    5 +++++
 gladeui/glade-palette.c |    5 ++---
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 453786f..54953af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-21  Tristan Van Berkom <tristanvb openismus com>
+
+	* gladeui/glade-palette.c: Dont strdup the adaptor names in the local hash table (those
+	  strings are constant data, no need to dup them).
+
 2011-01-19  Tristan Van Berkom <tristanvb openismus com>
 
 	* plugins/gtk+/gtk+.xml.in: Remove GtkTreeSelection from the palette, it's only available
diff --git a/gladeui/glade-palette.c b/gladeui/glade-palette.c
index d1a3ebe..1f5efa9 100644
--- a/gladeui/glade-palette.c
+++ b/gladeui/glade-palette.c
@@ -331,7 +331,7 @@ glade_palette_new_item (GladePalette * palette, GladeWidgetAdaptor * adaptor)
   gtk_widget_show (item);
 
   g_hash_table_insert (palette->priv->button_table, 
-		       g_strdup (glade_widget_adaptor_get_name (adaptor)), 
+		       (gchar *)glade_widget_adaptor_get_name (adaptor),
 		       item);
 
   return item;
@@ -638,8 +638,7 @@ glade_palette_init (GladePalette * palette)
 
   priv = palette->priv = GLADE_PALETTE_GET_PRIVATE (palette);
 
-  priv->button_table = g_hash_table_new_full (g_str_hash, g_str_equal,
-					      (GDestroyNotify)g_free, NULL);
+  priv->button_table = g_hash_table_new (g_str_hash, g_str_equal);
 
   priv->item_appearance      = GLADE_ITEM_ICON_ONLY;
   priv->use_small_item_icons = FALSE;



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