X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=gfio.c;h=65302e6075a01daad0b794417909e0e213b4f66a;hb=c4ec0a1d623193b4d344e31b07c6720ecf90323f;hp=313894169a3976fe8a472ce9d748fa1f81c34daa;hpb=0950e832e5f2ef92fbfad92c8a9d20480e3b13f9;p=fio.git diff --git a/gfio.c b/gfio.c index 31389416..65302e60 100644 --- a/gfio.c +++ b/gfio.c @@ -654,6 +654,12 @@ static void gfio_client_added(struct gui_entry *ge, struct fio_client *client) gc->o_list_nr++; } +static void gfio_clear_graph_data(struct gfio_graphs *g) +{ + graph_clear_values(g->iops_graph); + graph_clear_values(g->bandwidth_graph); +} + static void connect_clicked(GtkWidget *widget, gpointer data) { struct gui_entry *ge = data; @@ -694,6 +700,7 @@ static void connect_clicked(GtkWidget *widget, gpointer data) if (!ge->ui->handler_running) pthread_create(&ge->ui->t, NULL, job_thread, ge->ui); gfio_set_state(ge, GE_STATE_CONNECTED); + gfio_clear_graph_data(&ge->graphs); } else { gfio_report_error(ge, "Failed to connect to %s: %s\n", ge->client->client->hostname, strerror(-ret)); } @@ -1670,8 +1677,11 @@ static void init_ui(int *argc, char **argv[], struct gui *ui) * Without it, the update that happens in gfio_update_thread_status * doesn't really happen in a timely fashion, you need expose events */ +#if !GTK_CHECK_VERSION(2, 24, 0) if (!g_thread_supported()) g_thread_init(NULL); +#endif + gdk_threads_init(); gtk_init(argc, argv);