aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-header-item.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-04-12 04:02:31 +0800
committerChris Lahey <clahey@src.gnome.org>2002-04-12 04:02:31 +0800
commit0479b8d9a06faa76dd5622fd8549f380f8cac242 (patch)
tree36defdfc0d9bd71d667c0e3b574774abcdb7b33e /widgets/table/e-table-header-item.c
parent9f6c9f9e1dad0fd03722e6dddf3a25e63c8a1f9d (diff)
downloadgsoc2013-evolution-0479b8d9a06faa76dd5622fd8549f380f8cac242.tar
gsoc2013-evolution-0479b8d9a06faa76dd5622fd8549f380f8cac242.tar.gz
gsoc2013-evolution-0479b8d9a06faa76dd5622fd8549f380f8cac242.tar.bz2
gsoc2013-evolution-0479b8d9a06faa76dd5622fd8549f380f8cac242.tar.lz
gsoc2013-evolution-0479b8d9a06faa76dd5622fd8549f380f8cac242.tar.xz
gsoc2013-evolution-0479b8d9a06faa76dd5622fd8549f380f8cac242.tar.zst
gsoc2013-evolution-0479b8d9a06faa76dd5622fd8549f380f8cac242.zip
Fixed a memory leak here by using the "selection-done" signal.
2002-04-11 Christopher James Lahey <clahey@ximian.com> * e-table-header-item.c (ethi_header_context_menu): Fixed a memory leak here by using the "selection-done" signal. * e-table.c, e-table.h (white_item_event): Added the "white_space_event" signal. svn path=/trunk/; revision=16439
Diffstat (limited to 'widgets/table/e-table-header-item.c')
-rw-r--r--widgets/table/e-table-header-item.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index ba149237ba..1542853d16 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -40,6 +40,7 @@
#include "gal/util/e-xml-utils.h"
#include "gal/widgets/e-canvas.h"
#include "gal/widgets/e-popup-menu.h"
+#include "gal/widgets/e-gui-utils.h"
#include "e-table-header.h"
#include "e-table-header-utils.h"
#include "e-table-col-dnd.h"
@@ -1439,6 +1440,12 @@ ethi_popup_customize_view(GtkWidget *widget, EthiHeaderInfo *info)
}
}
+static void
+free_popup_info (GtkWidget *w, EthiHeaderInfo *info)
+{
+ g_free (info);
+}
+
/* Bit 1 is always disabled. */
/* Bit 2 is disabled if not "sortable". */
/* Bit 4 is disabled if we don't have a pointer to our table object. */
@@ -1466,16 +1473,21 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event)
{
EthiHeaderInfo *info = g_new(EthiHeaderInfo, 1);
ETableCol *col;
+ GtkMenu *popup;
info->ethi = ethi;
info->col = ethi_find_col_by_x (ethi, event->x);
col = e_table_header_get_column (ethi->eth, info->col);
- e_popup_menu_run (ethi_context_menu, (GdkEvent *) event,
- 1 +
- (col->sortable ? 0 : 2) +
- ((ethi->table || ethi->tree) ? 0 : 4) +
- ((e_table_header_count (ethi->eth) > 1) ? 0 : 8),
- ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) +
- 128, info);
+
+ popup = e_popup_menu_create (ethi_context_menu,
+ 1 +
+ (col->sortable ? 0 : 2) +
+ ((ethi->table || ethi->tree) ? 0 : 4) +
+ ((e_table_header_count (ethi->eth) > 1) ? 0 : 8),
+ ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) +
+ 128, info);
+ gtk_signal_connect (GTK_OBJECT (popup), "selection-done",
+ GTK_SIGNAL_FUNC (free_popup_info), info);
+ e_popup_menu (popup, (GdkEvent *) event);
}
static void