no args for gtk_init
authorJean-Philippe Orsini <jeanfi@gmail.com>
Fri, 9 Sep 2011 11:39:16 +0000 (11:39 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Fri, 9 Sep 2011 11:39:16 +0000 (11:39 +0000)
 fixed memleak when window not drawable

src/graph.c
src/main.c

index 988ea4a..da7bbfa 100644 (file)
@@ -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;
index a56e043..b28333c 100644 (file)
@@ -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;