changeset 2623:66164831c228

[gaim-migrate @ 2636] this probably shouldn't matter, but i had something *really* odd happen to me related to the name, so i'm not risking it. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 26 Oct 2001 23:20:20 +0000
parents 733471f39ac9
children 4d5c2c913750
files src/dialogs.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialogs.c	Fri Oct 26 23:07:08 2001 +0000
+++ b/src/dialogs.c	Fri Oct 26 23:20:20 2001 +0000
@@ -3467,7 +3467,14 @@
 	g_free(view);
 }
 
-void show_log(char *name)
+static void des_log_win(GtkObject *win, gpointer data)
+{
+	char *x = gtk_object_get_user_data(win);
+	if (x)
+		g_free(x);
+}
+
+void show_log(char *nm)
 {
 	gchar filename[256];
 	gchar buf[BUF_LONG];
@@ -3487,6 +3494,7 @@
 	GtkWidget *last = NULL;
 	GtkWidget *frame;
 	struct view_log *view;
+	char *name = nm ? g_strdup(nm) : NULL;
 
 	int options;
 	guint block;
@@ -3503,6 +3511,8 @@
 		options ^= GTK_IMHTML_NO_SIZES;
 
 	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+	gtk_object_set_user_data(GTK_OBJECT(window), name);
+	gtk_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(des_log_win), NULL);
 	gtk_window_set_wmclass(GTK_WINDOW(window), "log", "Gaim");
 	if (name)
 		g_snprintf(buf, BUF_LONG, "Gaim - Conversations with %s", name);