diff options
Diffstat (limited to 'ui/gtk/mcast_stream_dlg.c')
-rw-r--r-- | ui/gtk/mcast_stream_dlg.c | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/ui/gtk/mcast_stream_dlg.c b/ui/gtk/mcast_stream_dlg.c index faba11c867..16ad6efd12 100644 --- a/ui/gtk/mcast_stream_dlg.c +++ b/ui/gtk/mcast_stream_dlg.c @@ -48,13 +48,14 @@ #include "ui/gtk/gtkglobals.h" #include "ui/gtk/stock_icons.h" -static void mcaststream_dlg_update(void *ti_ptr); +static void mcaststream_tap_reset(mcaststream_tapinfo_t *tapinfo); +static void mcaststream_tap_draw(mcaststream_tapinfo_t *tapinfo); /****************************************************************************/ /* the one and only global mcaststream_tapinfo_t structure for tshark and wireshark. */ static mcaststream_tapinfo_t the_tapinfo_struct = - {NULL, NULL, mcaststream_dlg_update, NULL, 0, NULL, FALSE}; + {NULL, mcaststream_tap_reset, mcaststream_tap_draw, NULL, 0, NULL, FALSE}; /* Capture callback data keys */ #define E_MCAST_ENTRY_1 "burst_interval" @@ -748,17 +749,8 @@ mcaststream_dlg_create(void) /* update the contents of the dialog box clist */ /* list: pointer to list of mcast_stream_info_t* */ void -mcaststream_dlg_update(void *ti_ptr) +mcaststream_dlg_update(GList *list) { - GList *list; - mcaststream_tapinfo_t *tapinfo = (mcaststream_tapinfo_t *)ti_ptr; - - if (!tapinfo) { - return; - } - - list = tapinfo->strinfo_list; - if (mcast_stream_dlg != NULL) { gtk_list_store_clear(list_store); streams_nb = 0; @@ -776,6 +768,29 @@ mcaststream_dlg_update(void *ti_ptr) last_list = list; } +static void +mcaststream_tap_reset(mcaststream_tapinfo_t *tapinfo _U_) +{ + GtkTreeSelection *selection; + if (mcast_stream_dlg != NULL) { + /* Disable selection to avoid mcaststream_on_select_row from + * triggering and thereby accessing invalid memory. */ + selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(list_w)); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_NONE); + gtk_list_store_clear(list_store); + gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE); + streams_nb = 0; + } +} + +static void +mcaststream_tap_draw(mcaststream_tapinfo_t *tapinfo) +{ + if (tapinfo) { + mcaststream_dlg_update(tapinfo->strinfo_list); + } +} + #if 0 static void mcaststream_dlg_mark_packet(mcaststream_tapinfo_t *tapinfo _U_, frame_data *fd) { |