From d2fe58c56857e9e4b2e37f87174da6956b0d985c Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Sat, 12 Feb 2000 02:03:58 +0000 Subject: Implemented. 2000-02-11 Federico Mena Quintero * cal-client.c (cal_client_update_object): Implemented. * cal.c (cal_notify_update): New function to notify the listener about an updated object. (Cal_update_object): Implemented. (Cal_get_uids): set_release() the sequence to TRUE. (Cal_get_events_in_range): Likewise. * cal-backend.c (remove_object): New function to remove objects from a calendar backend. (cal_backend_update_object): New public function to update an object and notify clients about it. * evolution-calendar.idl (Cal): Added update_object() and delete_object() methods. (Listener): Removed the obj_changed method and renamed obj_added to obj_updated. We now only have updated and removed notifiers. * cal-listener.[ch]: Removed the "changed" notification code. Changed the "added" notification code to the "updated" notification. * cal-client.c: Likewise. * tlacuache.c (create_cal_factory): Connect to "destroy" on the factory and exit the main loop when the factory is destroyed. * cal-factory.c (backend_destroy_cb): New callback used when a backend is destroyed. Removes the backend from the factory's hash table and unrefs the factory if all backends go away. (add_calendar_client): Free the environment. * cal.c (cal_new): Use bonobo_object_unref() if we fail to initialize. * cal-listener.c (cal_listener_new): Likewise. * layout.c (layout_events): Plug li.partition memory leak. svn path=/trunk/; revision=1742 --- calendar/pcs/tlacuache.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'calendar/pcs/tlacuache.c') diff --git a/calendar/pcs/tlacuache.c b/calendar/pcs/tlacuache.c index 602cbfbe27..35bb585862 100644 --- a/calendar/pcs/tlacuache.c +++ b/calendar/pcs/tlacuache.c @@ -28,11 +28,6 @@ -/* The calendar factory */ -static CalFactory *factory; - - - /* Stuff that the un-converted alarm code needs to build */ int debug_alarms = FALSE; @@ -54,10 +49,18 @@ calendar_notify (time_t time, CalendarAlarm *which, void *data) +/* Callback used when the calendar factory is destroyed */ +static void +factory_destroy_cb (GtkObject *object, gpointer data) +{ + gtk_main_quit (); +} + /* Creates and registers the calendar factory */ static gboolean create_cal_factory (void) { + CalFactory *factory; CORBA_Object object; CORBA_Environment ev; int result; @@ -79,14 +82,20 @@ create_cal_factory (void) if (ev._major != CORBA_NO_EXCEPTION || result == -1) { g_message ("create_cal_factory(): could not register the calendar factory"); + bonobo_object_unref (BONOBO_OBJECT (factory)); CORBA_exception_free (&ev); return FALSE; } else if (result == -2) { g_message ("create_cal_factory(): a calendar factory is already registered"); + bonobo_object_unref (BONOBO_OBJECT (factory)); CORBA_exception_free (&ev); return FALSE; } + gtk_signal_connect (GTK_OBJECT (factory), "destroy", + GTK_SIGNAL_FUNC (factory_destroy_cb), + NULL); + CORBA_exception_free (&ev); return TRUE; } -- cgit v1.2.3