diff src/gtkstatusselector.c @ 10504:1a97d5e88d12

[gaim-migrate @ 11796] Lots of things here: - Several memory leak fixes - A few invalid memory access fixes - Fix a yahoo crash going idle when away - Fix Add user in chats to actually fill in the screenname - Add gaim_account_{get,set}_enabled to perl - Fix command priorities (fixes /me in IRC) - Fix MSN notification server transfer to be quiet about it - Fix MSN blist sync if user has insane friendly name - Make the docklet less crash-happy if it fails to embed in 3 seconds - Only probe for native plugins with the correct file extension - 1 typo fix :) ... and quite possibly something else I forgot. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Tue, 11 Jan 2005 17:25:06 +0000
parents d51f8280b507
children 364a2ef907ae
line wrap: on
line diff
--- a/src/gtkstatusselector.c	Tue Jan 11 02:00:44 2005 +0000
+++ b/src/gtkstatusselector.c	Tue Jan 11 17:25:06 2005 +0000
@@ -234,7 +234,7 @@
 }
 
 static gboolean
-get_selected_data(GaimGtkStatusSelector *selector, const char **text, const char **status_type_id)
+get_selected_data(GaimGtkStatusSelector *selector, char **text, const char **status_type_id)
 {
 #if GTK_CHECK_VERSION(2,4,0)
 	GtkTreeIter iter;
@@ -256,7 +256,7 @@
 	i = gtk_option_menu_get_history(GTK_OPTION_MENU(selector->priv->optmenu));
 	l = GTK_MENU_SHELL(selector->priv->menu)->children;
 	item = g_list_nth_data(l, i);
-	*text = g_object_get_data(G_OBJECT(item), GAIM_SELECTOR_TEXT);
+	*text = g_strdup(g_object_get_data(G_OBJECT(item), GAIM_SELECTOR_TEXT));
 	*status_type_id = g_object_get_data(G_OBJECT(item), GAIM_SELECTOR_STATUS_TYPE_ID);
 	return TRUE;
 #endif
@@ -270,7 +270,7 @@
 status_switched_cb(GtkWidget *combo, GaimGtkStatusSelector *selector)
 {
 	const char *status_type_id = NULL;
-	const char *text = NULL;
+	char *text = NULL;
 
 	/* Reset the status selector */
 	if (selector->priv->entry_timer != 0)
@@ -334,6 +334,7 @@
 			key_press_cb(NULL, NULL, selector);
 		}
 	}
+	g_free(text);
 }
 
 /**
@@ -348,7 +349,7 @@
 {
 	GaimGtkStatusSelector *selector = (GaimGtkStatusSelector *)data;
 	const char *status_type_id;
-	const char *text;
+	char *text;
 	gchar *message;
 	GList *l;
 
@@ -358,7 +359,10 @@
 		return FALSE;
 
 	if (status_type_id == NULL)
+	{
+		g_free(text);
 		return FALSE;
+	}
 
 	message = gtk_imhtml_get_markup(GTK_IMHTML(selector->priv->entry));
 
@@ -385,6 +389,9 @@
 		}
 	}
 
+	g_free(text);
+	g_free(message);
+
 	return FALSE;
 }