Mercurial > pidgin.yaz
comparison src/conversation.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 | 265a3c9d0557 |
children | 6190cf2c95a9 |
comparison
equal
deleted
inserted
replaced
3249:dbbdf3a55999 | 3250:0970eabdd8df |
---|---|
3439 gtk_widget_show(c->save_icon); | 3439 gtk_widget_show(c->save_icon); |
3440 } | 3440 } |
3441 | 3441 |
3442 static gboolean icon_menu(GtkObject *obj, GdkEventButton *e, struct conversation *c) | 3442 static gboolean icon_menu(GtkObject *obj, GdkEventButton *e, struct conversation *c) |
3443 { | 3443 { |
3444 GtkWidget *menu; | 3444 static GtkWidget *menu = NULL; |
3445 GtkWidget *button; | 3445 GtkWidget *button; |
3446 | 3446 |
3447 if (e->button != 3) | 3447 if (e->button != 3) |
3448 return FALSE; | 3448 return FALSE; |
3449 if (e->type != GDK_BUTTON_PRESS) | 3449 if (e->type != GDK_BUTTON_PRESS) |
3450 return FALSE; | 3450 return FALSE; |
3451 | |
3452 /* | |
3453 * If a menu already exists, destroy it before creating a new one, | |
3454 * thus freeing-up the memory it occupied. | |
3455 */ | |
3456 if(menu) | |
3457 gtk_widget_destroy(menu); | |
3451 | 3458 |
3452 menu = gtk_menu_new(); | 3459 menu = gtk_menu_new(); |
3453 | 3460 |
3454 if (c->icon_timer) { | 3461 if (c->icon_timer) { |
3455 button = gtk_menu_item_new_with_label(_("Disable Animation")); | 3462 button = gtk_menu_item_new_with_label(_("Disable Animation")); |