From 562717e70a312939a8c9e828f587cb2f1e4a3b24 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Fri, 4 May 2001 15:44:17 +0000 Subject: unref the calcomponent when we're done with it 2001-05-04 JP Rosevear * gui/calendar-model.c (calendar_model_append_row): unref the calcomponent when we're done with it * cal-util/cal-component.c (cal_component_gen_uid): free the iso date string when we finish with it svn path=/trunk/; revision=9670 --- calendar/cal-util/cal-component.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'calendar/cal-util') diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c index b7aeef7a8c..237bf56842 100644 --- a/calendar/cal-util/cal-component.c +++ b/calendar/cal-util/cal-component.c @@ -331,6 +331,7 @@ cal_component_destroy (GtkObject *object) char * cal_component_gen_uid (void) { + char *iso, *ret; static char *hostname; time_t t = time (NULL); static int serial; @@ -345,14 +346,17 @@ cal_component_gen_uid (void) hostname = "localhost"; } - return g_strdup_printf ( - "%s-%d-%d-%d-%d@%s", - isodate_from_time_t (t), - getpid (), - getgid (), - getppid (), - serial++, - hostname); + iso = isodate_from_time_t (t); + ret = g_strdup_printf ("%s-%d-%d-%d-%d@%s", + iso, + getpid (), + getgid (), + getppid (), + serial++, + hostname); + g_free (iso); + + return ret; } /** -- cgit v1.2.3