aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/capture_info_dlg.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2007-05-10 22:30:29 +0000
committerGerald Combs <gerald@wireshark.org>2007-05-10 22:30:29 +0000
commit06886379c7ce96655b0a424cde831f5540e60be2 (patch)
tree048585414f5f0c5d2e47466c62fd98aedad01ebc /gtk/capture_info_dlg.c
parentf43afbaf356eb2c55d54ae1c3d23d979978c9269 (diff)
On slow displays (such as RDP sessions), it looks like the "update"
callback routines might get called before we're ready for them. Add checks to handle this. Fixup whitespace. svn path=/trunk/; revision=21744
Diffstat (limited to 'gtk/capture_info_dlg.c')
-rw-r--r--gtk/capture_info_dlg.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gtk/capture_info_dlg.c b/gtk/capture_info_dlg.c
index 4aacb4357f..4acadac3e0 100644
--- a/gtk/capture_info_dlg.c
+++ b/gtk/capture_info_dlg.c
@@ -100,6 +100,9 @@ capture_info_ui_update_cb(gpointer data)
capture_info *cinfo = data;
capture_info_ui_t *info = cinfo->ui;
+ if (!info) /* ...which might happen on slow displays? */
+ return 1;
+
cinfo->running_time = time(NULL) - info->start_time;
capture_info_ui_update(cinfo);
return 1; /* call the timer again */
@@ -154,7 +157,7 @@ const gchar *iface)
*
* If we have a descriptive name for the interface, show that,
* rather than its raw name. On NT 5.x (2K/XP/Server2K3), the
- * interface name is something like "\Device\NPF_{242423..."
+ * interface name is something like "\Device\NPF_{242423..."
* which is pretty useless to the normal user. On other platforms,
* it might be less cryptic, but if a more descriptive name is
* available, we should still use that.
@@ -293,8 +296,11 @@ capture_info *cinfo)
capture_info_ui_t *info = cinfo->ui;
+ if (!info) /* ...which might happen on slow displays? */
+ return;
+
/* display running time */
- g_snprintf(label_str, sizeof(label_str), "%02ld:%02ld:%02ld",
+ g_snprintf(label_str, sizeof(label_str), "%02ld:%02ld:%02ld",
(long)(cinfo->running_time/3600), (long)((cinfo->running_time%3600)/60),
(long)(cinfo->running_time%60));
gtk_label_set(GTK_LABEL(info->running_time_lb), label_str);
@@ -328,12 +334,16 @@ capture_info *cinfo)
{
capture_info_ui_t *info = cinfo->ui;
+ if (!info) /* ...which probably shouldn't happen */
+ return;
+
gtk_timeout_remove(info->timer_id);
/* called from capture engine, so it's ok to destroy the dialog here */
gtk_grab_remove(GTK_WIDGET(info->cap_w));
window_destroy(GTK_WIDGET(info->cap_w));
g_free(info);
+ cinfo->ui = NULL;
}