im.pidgin.pidgin: 149ba15a619f096948289d3bb412d21a900dc0a7

datallah at pidgin.im datallah at pidgin.im
Mon Jan 14 17:30:40 EST 2008


-----------------------------------------------------------------
Revision: 149ba15a619f096948289d3bb412d21a900dc0a7
Ancestor: 99d368c57b2111b4808667a40daae808d642b63d
Author: datallah at pidgin.im
Date: 2008-01-14T22:23:54
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtklog.c

ChangeLog: 

Some more little leak fixes.

-------------- next part --------------
============================================================
--- pidgin/gtklog.c	51befd7620d86f700cc95e4281553830c948e1b3
+++ pidgin/gtklog.c	4d768fdac97ec90b4c0d0efbe86acc79dba1ad84
@@ -139,7 +139,7 @@ static void search_cb(GtkWidget *button,
 	{
 		/* Searching for the same term acts as "Find Next" */
 		gtk_imhtml_search_find(GTK_IMHTML(lv->imhtml), lv->search);
-		return;	
+		return;
 	}
 
 	pidgin_set_cursor(lv->window, GDK_WATCH);
@@ -321,7 +321,7 @@ static void log_delete_log_cb(GtkWidget 
 	data2[0] = lv->treestore;
 	data2[1] = data[3]; /* iter */
 	data2[2] = log;
-	purple_request_action(lv, NULL, "Delete Log?", tmp, 0, 
+	purple_request_action(lv, NULL, "Delete Log?", tmp, 0,
 						NULL, NULL, NULL,
 						data2, 2,
 						_("Delete"), delete_log_cb,
@@ -556,8 +556,13 @@ static PidginLogViewer *display_log_view
 				if (!purple_prefs_get_bool("/purple/logging/log_chats"))
 					log_preferences = _("Chats will only be logged if the \"Log all chats\" preference is enabled.");
 			}
+			g_free(ht->screenname);
+			g_free(ht);
 		}
 
+		if(icon != NULL)
+			gtk_widget_destroy(icon);
+
 		purple_notify_info(NULL, title, _("No logs were found"), log_preferences);
 		return NULL;
 	}
@@ -731,18 +736,19 @@ void pidgin_log_show_contact(PurpleConta
 }
 
 void pidgin_log_show_contact(PurpleContact *contact) {
-	struct log_viewer_hash_t *ht = g_new0(struct log_viewer_hash_t, 1);
+	struct log_viewer_hash_t *ht;
 	PurpleBlistNode *child;
 	PidginLogViewer *lv = NULL;
 	GList *logs = NULL;
 	GdkPixbuf *pixbuf;
-	GtkWidget *image = gtk_image_new();
+	GtkWidget *image;
 	const char *name = NULL;
 	char *title;
 	int total_log_size = 0;
 
 	g_return_if_fail(contact != NULL);
 
+	ht = g_new0(struct log_viewer_hash_t, 1);
 	ht->type = PURPLE_LOG_IM;
 	ht->contact = contact;
 
@@ -764,9 +770,16 @@ void pidgin_log_show_contact(PurpleConta
 	}
 	logs = g_list_sort(logs, purple_log_compare);
 
+	image = gtk_image_new();
 	pixbuf = gtk_widget_render_icon(image, PIDGIN_STOCK_STATUS_PERSON,
 					gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL), "GtkWindow");
-	gtk_image_set_from_pixbuf(GTK_IMAGE(image), pixbuf);
+	if (pixbuf) {
+		gtk_image_set_from_pixbuf(GTK_IMAGE(image), pixbuf);
+		g_object_unref(pixbuf);
+	} else {
+		gtk_widget_destroy(image);
+		image = NULL;
+	}
 
 	if (contact->alias != NULL)
 		name = contact->alias;


More information about the Commits mailing list