From a023b22c3f2f126e5c96c1c407ed2d8a0cb55cac Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Mon, 29 Oct 2001 00:15:09 +0000 Subject: removed this function, as we don't need to unref at all the WombatClient 2001-10-28 Rodrigo Moya * cal-client/cal-client.c (destroy_wombat_client): removed this function, as we don't need to unref at all the WombatClient object, since it is aggregated to the CalListener object, which will take care of unrefing it (Fixes Ximian #12001) (cal_client_open_calendar): create the WombatClient here svn path=/trunk/; revision=14306 --- calendar/cal-client/cal-client.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'calendar/cal-client') diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c index 5e51540e28..f3035ae4b8 100644 --- a/calendar/cal-client/cal-client.c +++ b/calendar/cal-client/cal-client.c @@ -218,31 +218,8 @@ cal_client_init (CalClient *client) priv->uri = NULL; priv->factories = NULL; priv->timezones = g_hash_table_new (g_str_hash, g_str_equal); + priv->w_client = NULL; priv->default_zone = icaltimezone_get_utc_timezone (); - - /* create the WombatClient */ - priv->w_client = wombat_client_new ( - (WombatClientGetPasswordFn) client_get_password_cb, - (WombatClientForgetPasswordFn) client_forget_password_cb, - (gpointer) client); -} - -/* Gets rid of the WombatClient that a client knows about */ -static void -destroy_wombat_client (CalClient *client) -{ - CalClientPrivate *priv; - - g_return_if_fail (client != NULL); - g_return_if_fail (IS_CAL_CLIENT (client)); - - priv = client->priv; - - if (!priv->w_client) - return; - - bonobo_object_unref (BONOBO_OBJECT (priv->w_client)); - priv->w_client = NULL; } /* Gets rid of the factories that a client knows about */ @@ -352,7 +329,7 @@ cal_client_destroy (GtkObject *object) priv->listener = NULL; } - destroy_wombat_client (client); + priv->w_client = NULL; destroy_factories (client); destroy_cal (client); @@ -745,6 +722,11 @@ cal_client_open_calendar (CalClient *client, const char *str_uri, gboolean only_ return FALSE; } + /* create the WombatClient */ + priv->w_client = wombat_client_new ( + (WombatClientGetPasswordFn) client_get_password_cb, + (WombatClientForgetPasswordFn) client_forget_password_cb, + (gpointer) client); bonobo_object_add_interface (BONOBO_OBJECT (priv->listener), BONOBO_OBJECT (priv->w_client)); -- cgit v1.2.3