aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gncal-full-day.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@nuclecu.unam.mx>1998-04-15 14:37:34 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-15 14:37:34 +0800
commitca50d9fad97731aefa9bca4075ba6f655c6e742e (patch)
tree3016f224fe4f7adbc2552273e1e95c4014b546c2 /calendar/gui/gncal-full-day.c
parent32c476890163a5489b655b56a26c79f451135a2c (diff)
downloadgsoc2013-evolution-ca50d9fad97731aefa9bca4075ba6f655c6e742e.tar
gsoc2013-evolution-ca50d9fad97731aefa9bca4075ba6f655c6e742e.tar.gz
gsoc2013-evolution-ca50d9fad97731aefa9bca4075ba6f655c6e742e.tar.bz2
gsoc2013-evolution-ca50d9fad97731aefa9bca4075ba6f655c6e742e.tar.lz
gsoc2013-evolution-ca50d9fad97731aefa9bca4075ba6f655c6e742e.tar.xz
gsoc2013-evolution-ca50d9fad97731aefa9bca4075ba6f655c6e742e.tar.zst
gsoc2013-evolution-ca50d9fad97731aefa9bca4075ba6f655c6e742e.zip
Routine to destory rows array properly.
1998-04-15 Miguel de Icaza <miguel@nuclecu.unam.mx> * gncal-full-day.c (layout_kill_rows): Routine to destory rows array properly. * gncal-year-view.c (gncal_year_view_new): Add missing year in call to strftime. * calobj.c (ical_object_create_from_vobject): Fixed memory leaks from the return values of versit's fakeCString. svn path=/trunk/; revision=136
Diffstat (limited to 'calendar/gui/gncal-full-day.c')
-rw-r--r--calendar/gui/gncal-full-day.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/calendar/gui/gncal-full-day.c b/calendar/gui/gncal-full-day.c
index a9c157c172..eac1d3fddc 100644
--- a/calendar/gui/gncal-full-day.c
+++ b/calendar/gui/gncal-full-day.c
@@ -433,7 +433,7 @@ child_set_pos (GncalFullDay *fullday, Child *child, int x, int y, int width, int
}
static struct layout_row *
-layout_get_rows (GncalFullDay *fullday)
+layout_get_rows (GncalFullDay *fullday, int *rowcount)
{
struct layout_row *rows;
int max_i;
@@ -444,6 +444,7 @@ layout_get_rows (GncalFullDay *fullday)
get_tm_range (fullday, fullday->lower, fullday->upper, NULL, NULL, NULL, &f_rows);
+ *rowcount = f_rows;
rows = g_new0 (struct layout_row, f_rows);
max_i = 0;
@@ -467,6 +468,16 @@ layout_get_rows (GncalFullDay *fullday)
}
static void
+layout_kill_rows (struct layout_row *rows, int f_rows)
+{
+ int i;
+
+ for (i = 0; i < f_rows; i++)
+ g_free (rows [i].slots);
+ g_free (rows);
+}
+
+static void
layout_get_child_intersections (Child *child, struct layout_row *rows, int *min, int *max)
{
int i, n;
@@ -573,9 +584,9 @@ layout_children (GncalFullDay *fullday)
struct layout_row *rows;
GList *children;
GtkWidget *widget;
- int left_x;
+ int left_x, rowcount;
- rows = layout_get_rows (fullday);
+ rows = layout_get_rows (fullday, &rowcount);
widget = GTK_WIDGET (fullday);
@@ -584,7 +595,7 @@ layout_children (GncalFullDay *fullday)
for (children = fullday->children; children; children = children->next)
layout_child (fullday, children->data, rows, left_x);
- g_free (rows);
+ layout_kill_rows (rows, rowcount);
}
guint