From: Jean-Philippe Orsini Date: Fri, 9 Sep 2011 11:39:16 +0000 (+0000) Subject: no args for gtk_init X-Git-Tag: v0.8.0.5~681 X-Git-Url: https://git.wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff_plain;h=d0378e3b947f915fdd462e21ae75ea58aa97b8cf no args for gtk_init fixed memleak when window not drawable --- diff --git a/src/graph.c b/src/graph.c index 988ea4a..da7bbfa 100644 --- a/src/graph.c +++ b/src/graph.c @@ -209,8 +209,8 @@ graph_update(struct psensor **sensors, cairo_surface_t *cst; cairo_t *cr, *cr_pixmap; - char *str_btime = time_to_str(get_graph_begin_time_s(config)); - char *str_etime = time_to_str(get_graph_end_time_s()); + char *str_btime; + char *str_etime; cairo_text_extents_t te_btime, te_etime, te_max, te_min; @@ -220,6 +220,9 @@ graph_update(struct psensor **sensors, if (!gtk_widget_is_drawable(w_graph)) return ; + str_btime = time_to_str(get_graph_begin_time_s(config)); + str_etime = time_to_str(get_graph_end_time_s()); + gtk_widget_get_allocation(w_graph, &galloc); width = galloc.width; height = galloc.height; diff --git a/src/main.c b/src/main.c index a56e043..b28333c 100644 --- a/src/main.c +++ b/src/main.c @@ -336,7 +336,7 @@ int main(int argc, char **argv) gdk_threads_init(); /* gdk_threads_enter(); */ - gtk_init(&argc, &argv); + gtk_init(NULL, NULL); #ifdef HAVE_LIBNOTIFY ui.notification_last_time = NULL;