Commit a38d221c authored by Jody Goldberg's avatar Jody Goldberg

Fix some uninitialized memory problems.

parent df1c0a4f
1999-09-18 Jody Goldberg <jgoldberg@home.com>
* gnumeric-chart.c (gnumeric_chart_destroy) : implement.
(gnumeric_chart_new) : Create.
* ms-chart.c (ms_excel_chart) : Init the chart.
* ms-escher.c : More radical changes to support just in time
merging. This seems to solve the last of the problems of which
records to merge and which not. Everything seems to add up.
......
......@@ -9,7 +9,19 @@
#include "gnumeric-chart.h"
GnumericChart *
gnumeric_chart_new ()
{
GnumericChart * res = (GnumericChart *) g_new (GnumericChart, 1);
res->series = NULL;
return res;
}
void
gnumeric_chart_destroy (GnumericChart * chart)
{
g_ptr_array_free (chart->series, FALSE);
chart->series = (GPtrArray *)0xdeadbeef; /* poison the pointer */
g_free (chart);
}
......@@ -19,6 +19,7 @@ typedef struct _GnumericChart
GPtrArray *series;
} GnumericChart;
extern GnumericChart * gnumeric_chart_new ();
extern void gnumeric_chart_destroy (GnumericChart * chart);
#endif /* GNUMERIC_CHART_H */
......@@ -1917,6 +1917,7 @@ ms_excel_chart (BiffQuery *q, ExcelWorkbook *wb, BIFF_BOF_DATA *bof)
state.depth = 0;
state.prev_opcode = 0xdead; /* Invalid */
state.wb = wb;
state.chart = gnumeric_chart_new();
if (ms_excel_chart_debug > 0)
puts ("{ CHART");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment