return ((timeend - timestart) / SVG_V_GRIDNR);
}
+/*
+ ***************************************************************************
+ * Free global graphs structures.
+ *
+ * IN:
+ * @out Pointer on array of chars for each graph definition.
+ * @outsize Size of array of chars for each graph definition.
+ * @spmin Array containing min values for graphs.
+ * @spmax Array containing max values for graphs.
+ ***************************************************************************
+ */
+void free_graphs(char **out, int *outsize, double *spmin, double *spmax)
+{
+ if (out) {
+ free(out);
+ }
+ if (outsize) {
+ free(outsize);
+ }
+ if (spmin) {
+ free(spmin);
+ }
+ if (spmax) {
+ free(spmax);
+ }
+}
+
/*
***************************************************************************
* Display all graphs for current activity.
/* Next graph */
(svg_p->graph_no) += a->g_nr;
-
- /* Free remaining structures */
- free(out);
- free(outsize);
- free(spmin);
- free(spmax);
}
/*
if (action & F_END) {
draw_activity_graphs(a, title, g_title, NULL, group, spmin, spmax,
out, outsize, svg_p, record_hdr);
+
+ /* Free remaining structures */
+ free_graphs(out, outsize, spmin, spmax);
}
}
if (action & F_END) {
draw_activity_graphs(a, title, g_title, NULL, group, spmin, spmax,
out, outsize, svg_p, record_hdr);
+
+ /* Free remaining structures */
+ free_graphs(out, outsize, spmin, spmax);
}
}