From 26cbf6cd5fb66c8c490bbb4d148b811139ec9210 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 8 Aug 2001 00:22:07 +0000 Subject: New function to stop further notification from happening. 2001-08-07 Federico Mena Quintero * cal-client/cal-listener.c (cal_listener_stop_notification): New function to stop further notification from happening. (impl_notifyCalOpened): Do not notify if requested. (impl_notifyObjUpdated): Likewise. (impl_notifyObjRemoved): Likewise. (impl_notifyCategoriesChanged): Likewise. (CalListenerPrivate): Do not keep a reference to the server-side Cal. This would create a circular reference since the server keeps a reference to the listener. (cal_listener_destroy): Likewise. (impl_notifyCalOpened): Likewise. * pcs/cal.c (cal_destroy): bonobo_object_release_unref() the listener. * cal-client/cal-client.c (cal_client_destroy): Ask the listener to stop notifications. Also, do not unref it as the server does that itself when we unref the Cal. svn path=/trunk/; revision=11758 --- calendar/cal-client/cal-client.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'calendar/cal-client/cal-client.c') diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c index 41e42613bb..f0519057d6 100644 --- a/calendar/cal-client/cal-client.c +++ b/calendar/cal-client/cal-client.c @@ -260,21 +260,6 @@ destroy_factory (CalClient *client) priv->factory = CORBA_OBJECT_NIL; } -/* Gets rid of the listener that a client knows about */ -static void -destroy_listener (CalClient *client) -{ - CalClientPrivate *priv; - - priv = client->priv; - - if (!priv->listener) - return; - - bonobo_object_unref (BONOBO_OBJECT (priv->listener)); - priv->listener = NULL; -} - /* Gets rid of the calendar client interface object that a client knows about */ static void destroy_cal (CalClient *client) @@ -337,9 +322,14 @@ cal_client_destroy (GtkObject *object) client = CAL_CLIENT (object); priv = client->priv; + /* The server unrefs the query listener, so we just NULL it out here */ + if (priv->listener) { + cal_listener_stop_notification (priv->listener); + priv->listener = NULL; + } + destroy_wombat_client (client); destroy_factory (client); - destroy_listener (client); destroy_cal (client); priv->load_state = CAL_CLIENT_LOAD_NOT_LOADED; -- cgit v1.2.3