im.pidgin.pidgin: f4cb0b01008f7485ff8e336ba2be02072dfef04e

datallah at pidgin.im datallah at pidgin.im
Sun Oct 14 19:30:35 EDT 2007


-----------------------------------------------------------------
Revision: f4cb0b01008f7485ff8e336ba2be02072dfef04e
Ancestor: f7d8e29aaf095f5ba757f935fc669f2b2443a811
Author: datallah at pidgin.im
Date: 2007-10-14T23:26:52
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkutils.c

ChangeLog: 

Fix reference leak of AtkObjects. Prevent an unnecessary allocation in pidgin_check_if_dir().

-------------- next part --------------
============================================================
--- pidgin/gtkutils.c	04771b82cd667c74ccf31f582e6de3502242f5d3
+++ pidgin/gtkutils.c	bb6fdf091be3c1589f637f07959bfa346078712a
@@ -850,16 +850,14 @@ pidgin_check_if_dir(const char *path, Gt
 gboolean
 pidgin_check_if_dir(const char *path, GtkFileSelection *filesel)
 {
-	char *dirname;
+	char *dirname = NULL;
 
 	if (g_file_test(path, G_FILE_TEST_IS_DIR)) {
 		/* append a / if needed */
 		if (path[strlen(path) - 1] != G_DIR_SEPARATOR) {
 			dirname = g_strconcat(path, G_DIR_SEPARATOR_S, NULL);
-		} else {
-			dirname = g_strdup(path);
 		}
-		gtk_file_selection_set_filename(filesel, dirname);
+		gtk_file_selection_set_filename(filesel, (dirname != NULL) ? dirname : path);
 		g_free(dirname);
 		return TRUE;
 	}
@@ -1178,14 +1176,15 @@ pidgin_set_accessible_relations (GtkWidg
 	label = gtk_widget_get_accessible (l);
 
 	/* Make sure mnemonics work */
-        gtk_label_set_mnemonic_widget(GTK_LABEL(l), w);
-	
+	gtk_label_set_mnemonic_widget(GTK_LABEL(l), w);
+
 	/* Create the labeled-by relation */
 	set = atk_object_ref_relation_set (acc);
 	rel_obj[0] = label;
 	relation = atk_relation_new (rel_obj, 1, ATK_RELATION_LABELLED_BY);
 	atk_relation_set_add (set, relation);
 	g_object_unref (relation);
+	g_object_unref(set);
 
 	/* Create the label-for relation */
 	set = atk_object_ref_relation_set (label);
@@ -1193,6 +1192,7 @@ pidgin_set_accessible_relations (GtkWidg
 	relation = atk_relation_new (rel_obj, 1, ATK_RELATION_LABEL_FOR);
 	atk_relation_set_add (set, relation);
 	g_object_unref (relation);
+	g_object_unref(set);
 }
 
 void


More information about the Commits mailing list