From 388c6a2d5dbbda429f12854141f640b91ece6590 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Tue, 24 Sep 2002 11:50:12 +0000 Subject: unref the QueryListener object. (query_construct): create an 2002-09-24 Rodrigo Moya * pcs/query.c (listener_died_cb): unref the QueryListener object. (query_construct): create an EComponentListener for the non-cached queries' listeners also. svn path=/trunk/; revision=18195 --- calendar/pcs/query.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'calendar/pcs') diff --git a/calendar/pcs/query.c b/calendar/pcs/query.c index 2ca9ad8409..debee6a920 100644 --- a/calendar/pcs/query.c +++ b/calendar/pcs/query.c @@ -1404,13 +1404,24 @@ listener_died_cb (EComponentListener *cl, gpointer data) { QueryPrivate *priv; Query *query = QUERY (data); + GNOME_Evolution_Calendar_QueryListener ql; + CORBA_Environment ev; priv = query->priv; - priv->listeners = g_list_remove (priv->listeners, e_component_listener_get_component (cl)); + ql = e_component_listener_get_component (cl); + priv->listeners = g_list_remove (priv->listeners, ql); priv->component_listeners = g_list_remove (priv->component_listeners, cl); gtk_object_unref (GTK_OBJECT (cl)); + + CORBA_exception_init (&ev); + bonobo_object_release_unref (ql, &ev); + + if (BONOBO_EX (&ev)) + g_message ("query_destroy(): Could not unref the listener\n"); + + CORBA_exception_free (&ev); } static void @@ -1572,6 +1583,7 @@ query_construct (Query *query, { QueryPrivate *priv; CORBA_Environment ev; + EComponentListener *cl; g_return_val_if_fail (query != NULL, NULL); g_return_val_if_fail (IS_QUERY (query), NULL); @@ -1592,6 +1604,11 @@ query_construct (Query *query, } CORBA_exception_free (&ev); + cl = e_component_listener_new (ql, 0); + priv->component_listeners = g_list_append (priv->component_listeners, cl); + gtk_signal_connect (GTK_OBJECT (cl), "component_died", + GTK_SIGNAL_FUNC (listener_died_cb), query); + priv->backend = backend; gtk_object_ref (GTK_OBJECT (priv->backend)); -- cgit