aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-12-19 20:28:05 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2015-01-04 16:46:52 +0000
commitff01bc6c4e0b07a95016fde9c1ff25aaf56585eb (patch)
treeff6e6c40fc012ea7222fc1db596de9c03ef871ce /ui
parent553da374461efb87436dbbed7d319d252d4fe2e6 (diff)
gtk: fix crash when moving columns
When the columns are moved, the packet list is redrawn from the columns-changed signal handler. Apparently GTK does not like that the parent contains got destroyed. Call packet_list_recreate outside the callback to workaround this issue. Since the signal handler is blocked, it can never be called twice (and there will always be at most one packet_list_recreate_delayed scheduled). Bug: 10795 Change-Id: Ia97d330c8bef747809fa09a8709a19cb03c7e00a Reviewed-on: https://code.wireshark.org/review/5881 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/gtk/packet_list.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ui/gtk/packet_list.c b/ui/gtk/packet_list.c
index 17ac2273f2..e8f74fc03e 100644
--- a/ui/gtk/packet_list.c
+++ b/ui/gtk/packet_list.c
@@ -599,6 +599,12 @@ packet_list_column_button_pressed_cb (GtkWidget *widget, GdkEvent *event, gpoint
return popup_menu_handler (widget, event, menu);
}
+static gboolean packet_list_recreate_delayed(gpointer user_data _U_)
+{
+ packet_list_recreate();
+ return FALSE;
+}
+
static void
column_dnd_changed_cb(GtkTreeView *tree_view, gpointer data _U_)
{
@@ -634,7 +640,9 @@ column_dnd_changed_cb(GtkTreeView *tree_view, gpointer data _U_)
prefs_main_write();
}
- packet_list_recreate();
+ /* The columns widget is part of the packets list, delay destruction to
+ * avoid triggering a use-after-free (maybe a GTK3 bug?) */
+ g_idle_add(packet_list_recreate_delayed, NULL);
}
static GtkWidget *