anjuta r4813 - in trunk: . libanjuta plugins/gtodo plugins/symbol-db



Author: sgranjoux
Date: Sun Mar  1 10:44:08 2009
New Revision: 4813
URL: http://svn.gnome.org/viewvc/anjuta?rev=4813&view=rev

Log:
	* plugins/gtodo/interface.c,
	plugins/gtodo/libgtodo.c,
	plugins/symbol-db/symbol-db-engine-core.c,
	libanjuta/anjuta-plugin-manager.c:
	Fix a few memory leaks thanks to Valgrind


Modified:
   trunk/ChangeLog
   trunk/libanjuta/anjuta-plugin-manager.c
   trunk/plugins/gtodo/interface.c
   trunk/plugins/gtodo/libgtodo.c
   trunk/plugins/symbol-db/symbol-db-engine-core.c

Modified: trunk/libanjuta/anjuta-plugin-manager.c
==============================================================================
--- trunk/libanjuta/anjuta-plugin-manager.c	(original)
+++ trunk/libanjuta/anjuta-plugin-manager.c	Sun Mar  1 10:44:08 2009
@@ -1982,6 +1982,7 @@
 			gchar *icon_path = NULL;
 			icon_path = g_strconcat (PACKAGE_PIXMAPS_DIR"/",
 									 icon_filename, NULL);
+			g_free (icon_filename);
 			/* DEBUG_PRINT ("Icon: %s", icon_path); */
 			icon_pixbuf = 
 				gdk_pixbuf_new_from_file (icon_path, NULL);
@@ -2009,19 +2010,20 @@
 		{
 			g_warning ("Plugin does not define Description attribute");
 		}
-		if (!anjuta_plugin_description_get_string (desc,
-												  "Anjuta Plugin",
-												  "Location",
-												  &location))
-		{
-			g_warning ("Plugin does not define Location attribute");
-		}
-		
 		if (plugin_name && plugin_desc)
 		{
 			GtkTreeIter iter;
 			gchar *text;
-			
+
+			if (!anjuta_plugin_description_get_string (desc,
+													  "Anjuta Plugin",
+													  "Location",
+													  &location))
+			{
+				g_warning ("Plugin does not define Location attribute");
+			}
+		
+		
 			text = g_markup_printf_escaped ("<span size=\"larger\" weight=\"bold\">%s</span>\n%s", plugin_name, plugin_desc);
 
 			gtk_list_store_append (GTK_LIST_STORE (model), &iter);
@@ -2037,6 +2039,8 @@
 			
 			selection_ids = g_list_prepend (selection_ids, location);
 		}
+		g_free (plugin_name);
+		g_free (plugin_desc);
 		node = g_list_next (node);
 	}
 	

Modified: trunk/plugins/gtodo/interface.c
==============================================================================
--- trunk/plugins/gtodo/interface.c	(original)
+++ trunk/plugins/gtodo/interface.c	Sun Mar  1 10:44:08 2009
@@ -264,14 +264,13 @@
 	/* testing icon factory.. hope it works a little */
 	factory = gtk_icon_factory_new();
 	/* random icon */
-	icons = gtk_icon_set_new();
 	icon_source = gtk_icon_source_new();
+	icons = gtk_icon_set_new();
 	gtk_icon_source_set_filename(icon_source, PIXMAP_PATH"/gtodo-edit.png");
 	gtk_icon_set_add_source(icons, icon_source);
 	gtk_icon_factory_add(factory, "gtodo-edit", icons);
 
 	icons = gtk_icon_set_new();
-	icon_source = gtk_icon_source_new();
 	gtk_icon_source_set_filename(icon_source, PIXMAP_PATH"/"ICON_FILE);
 	gtk_icon_set_add_source(icons, icon_source);
 	gtk_icon_factory_add(factory, "gtodo", icons);
@@ -279,12 +278,13 @@
 	/* added this because there isn no about availible in the default stock set. */
 	/* I call it gnome about so it still uses the one out off the current icon theme */
 	icons = gtk_icon_set_new();
-	icon_source = gtk_icon_source_new();
 	gtk_icon_source_set_filename(icon_source, PIXMAP_PATH"/gtodo-about.png");
 	gtk_icon_set_add_source(icons, icon_source);
 	gtk_icon_factory_add(factory, "gnome-stock-about", icons);
 	gtk_icon_factory_add_default (factory);
 
+	gtk_icon_source_free (icon_source);
+
 }
 
 void gtodo_set_hide_done(gboolean hide_it)

Modified: trunk/plugins/gtodo/libgtodo.c
==============================================================================
--- trunk/plugins/gtodo/libgtodo.c	(original)
+++ trunk/plugins/gtodo/libgtodo.c	Sun Mar  1 10:44:08 2009
@@ -828,6 +828,7 @@
 	cl = g_malloc0(sizeof(GTodoClient));
 	default_uri = g_strdup_printf("/%s/.gtodo/todos", g_getenv("HOME"));
 	cl->xml_file = g_file_new_for_path (default_uri);
+	g_free (default_uri);
 	/* check, open or create the correct xml file */
 	if(!gtodo_client_check_file(cl, &tmp_error))
 	{

Modified: trunk/plugins/symbol-db/symbol-db-engine-core.c
==============================================================================
--- trunk/plugins/symbol-db/symbol-db-engine-core.c	(original)
+++ trunk/plugins/symbol-db/symbol-db-engine-core.c	Sun Mar  1 10:44:08 2009
@@ -2962,6 +2962,7 @@
 	DEBUG_PRINT ("symbol_db_engine_open_db (): opening/connecting to "
 				 "database with %s...", cnc_string);
 	sdb_engine_connect_to_db (dbe, cnc_string);
+	g_free (cnc_string);
 
 	if (needs_tables_creation == TRUE)
 	{



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