Mercurial > pidgin
comparison src/buddy_chat.c @ 3250:0970eabdd8df
[gaim-migrate @ 3268]
Eliminated memory leaks resulting from the way pop-up menus are used.
committer: Tailor Script <tailor@pidgin.im>
author | Jim Seymour <jseymour> |
---|---|
date | Wed, 15 May 2002 02:21:21 +0000 |
parents | 5da7dae50d87 |
children | 0c7bd995eb03 |
comparison
equal
deleted
inserted
replaced
3249:dbbdf3a55999 | 3250:0970eabdd8df |
---|---|
844 struct conversation *c; | 844 struct conversation *c; |
845 if ((c = find_conversation(gtk_object_get_user_data(obj))) == NULL) | 845 if ((c = find_conversation(gtk_object_get_user_data(obj))) == NULL) |
846 c = new_conversation(gtk_object_get_user_data(obj)); | 846 c = new_conversation(gtk_object_get_user_data(obj)); |
847 set_convo_gc(c, b->gc); | 847 set_convo_gc(c, b->gc); |
848 } else if (event->button == 3 && event->type == GDK_BUTTON_PRESS) { | 848 } else if (event->button == 3 && event->type == GDK_BUTTON_PRESS) { |
849 GtkWidget *menu; | 849 static GtkWidget *menu = NULL; |
850 GtkWidget *button; | 850 GtkWidget *button; |
851 | |
852 /* | |
853 * If a menu already exists, destroy it before creating a new one, | |
854 * thus freeing-up the memory it occupied. | |
855 */ | |
856 if(menu) | |
857 gtk_widget_destroy(menu); | |
851 | 858 |
852 menu = gtk_menu_new(); | 859 menu = gtk_menu_new(); |
853 | 860 |
854 button = gtk_menu_item_new_with_label(_("IM")); | 861 button = gtk_menu_item_new_with_label(_("IM")); |
855 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(chat_press_im), b); | 862 gtk_signal_connect(GTK_OBJECT(button), "activate", GTK_SIGNAL_FUNC(chat_press_im), b); |