diff options
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 7 | ||||
-rw-r--r-- | calendar/pcs/query-backend.c | 14 |
2 files changed, 12 insertions, 9 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 8009f179a8..ea84ebe756 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2003-03-13 Rodrigo Moya <rodrigo@ximian.com> + + * pcs/query-backend.c (query_backend_new): use a weak ref instead + of connecting to backend's "destroy" signal. + (backend_destroyed_cb, query_destroyed_cb): changed to be weak + reference callbacks. + 2003-03-12 Rodrigo Moya <rodrigo@ximian.com> * gui/dialogs/save-comp.c (save_component_dialog): don't use diff --git a/calendar/pcs/query-backend.c b/calendar/pcs/query-backend.c index 8bace1023d..7d6cca041a 100644 --- a/calendar/pcs/query-backend.c +++ b/calendar/pcs/query-backend.c @@ -148,12 +148,10 @@ query_backend_get_type (void) } static void -backend_destroyed_cb (GObject *object, gpointer user_data) +backend_destroyed_cb (gpointer user_data, GObject *where_backend_was) { - CalBackend *backend = (CalBackend *) object; QueryBackend *qb = (QueryBackend *) user_data; - g_return_if_fail (IS_CAL_BACKEND (backend)); g_return_if_fail (IS_QUERY_BACKEND (qb)); g_object_unref (qb); @@ -215,9 +213,9 @@ object_removed_cb (CalBackend *backend, const char *uid, gpointer user_data) } static void -query_destroyed_cb (GObject *object, gpointer user_data) +query_destroyed_cb (gpointer user_data, GObject *where_the_object_was) { - Query *query = (Query *) object; + Query *query = (Query *) where_the_object_was; QueryBackend *qb = (QueryBackend *) user_data; g_return_if_fail (IS_QUERY (query)); @@ -276,8 +274,7 @@ query_backend_new (Query *query, CalBackend *backend) g_list_foreach (uidlist, foreach_uid_cb, qb); cal_obj_uid_list_free (uidlist); - g_signal_connect (G_OBJECT (backend), "destroy", - G_CALLBACK (backend_destroyed_cb), qb); + g_object_weak_ref (G_OBJECT (backend), backend_destroyed_cb, qb); g_signal_connect (G_OBJECT (backend), "obj_updated", G_CALLBACK (object_updated_cb), qb); g_signal_connect (G_OBJECT (backend), "obj_removed", @@ -287,8 +284,7 @@ query_backend_new (Query *query, CalBackend *backend) } qb->priv->queries = g_list_append (qb->priv->queries, query); - g_signal_connect (G_OBJECT (query), "destroy", - G_CALLBACK (query_destroyed_cb), qb); + g_object_weak_ref (G_OBJECT (query), query_destroyed_cb, qb); return qb; } |