From 08523fea6f9a0e9a02685cf3d6750973595ff482 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Thu, 24 Aug 2000 17:48:28 +0000 Subject: Do not alloc the struct icaltimetype but point to one on the stack. More 2000-08-24 JP Rosevear * gui/e-week-view.c (e_week_view_on_new_appointment): Do not alloc the struct icaltimetype but point to one on the stack. More importantly, set the date.tzid to NULL. svn path=/trunk/; revision=5007 --- calendar/ChangeLog | 6 ++++++ calendar/gui/e-week-view.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index d47461bc47..5f6b7ab8f6 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,9 @@ +2000-08-24 JP Rosevear + + * gui/e-week-view.c (e_week_view_on_new_appointment): Do not alloc + the struct icaltimetype but point to one on the stack. More + importantly, set the date.tzid to NULL. + 2000-08-24 JP Rosevear * gui/gnome-cal.c (save_event_object_cb): Make signal diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 4a84aed29e..2bb1ce4e05 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -2740,12 +2740,15 @@ e_week_view_on_new_appointment (GtkWidget *widget, gpointer data) EWeekView *week_view; CalComponent *comp; CalComponentDateTime date; + struct icaltimetype itt; + week_view = E_WEEK_VIEW (data); comp = cal_component_new (); cal_component_set_new_vtype (comp, CAL_COMPONENT_EVENT); - date.value = g_new0 (struct icaltimetype, 1); + date.value = &itt; + date.tzid = NULL; *date.value = icaltimetype_from_timet (week_view->day_starts[week_view->selection_start_day], @@ -2757,10 +2760,7 @@ e_week_view_on_new_appointment (GtkWidget *widget, gpointer data) FALSE); cal_component_set_dtend (comp, &date); - g_free (date.value); - gnome_calendar_edit_object (week_view->calendar, comp); - gtk_object_unref (GTK_OBJECT (comp)); } -- cgit