From d0378e3b947f915fdd462e21ae75ea58aa97b8cf Mon Sep 17 00:00:00 2001 From: Jean-Philippe Orsini Date: Fri, 9 Sep 2011 11:39:16 +0000 Subject: [PATCH] no args for gtk_init fixed memleak when window not drawable --- src/graph.c | 7 +++++-- src/main.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) 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; -- 2.7.4