diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2003-03-13 22:26:04 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2003-03-13 22:26:04 +0800 |
commit | 8a1a0ba450fb54e0ba8272840e817716d61dc73c (patch) | |
tree | 4803761e36fcfc339ac9d9cbf2c3b8c76eaba322 | |
parent | b1df789b256d5bdff8a1d8ba6023f4efef59dcad (diff) | |
download | gsoc2013-evolution-8a1a0ba450fb54e0ba8272840e817716d61dc73c.tar gsoc2013-evolution-8a1a0ba450fb54e0ba8272840e817716d61dc73c.tar.gz gsoc2013-evolution-8a1a0ba450fb54e0ba8272840e817716d61dc73c.tar.bz2 gsoc2013-evolution-8a1a0ba450fb54e0ba8272840e817716d61dc73c.tar.lz gsoc2013-evolution-8a1a0ba450fb54e0ba8272840e817716d61dc73c.tar.xz gsoc2013-evolution-8a1a0ba450fb54e0ba8272840e817716d61dc73c.tar.zst gsoc2013-evolution-8a1a0ba450fb54e0ba8272840e817716d61dc73c.zip |
use a weak ref instead of connecting to backend's "destroy" signal.
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.
svn path=/trunk/; revision=20271
-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; } |