From 1d8e220e443a123ee4fb9f25aa92e5c9bbc42463 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Mon, 3 Jun 2002 18:00:21 +0000 Subject: keep a reference to the Query object, to avoid crashes when the queries 2002-06-03 Rodrigo Moya * pcs/query.c: keep a reference to the Query object, to avoid crashes when the queries are destroyed before finishing processing. Fixes #25056. svn path=/trunk/; revision=17080 --- calendar/pcs/query.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'calendar/pcs') diff --git a/calendar/pcs/query.c b/calendar/pcs/query.c index 2006157e58..8e952a5727 100644 --- a/calendar/pcs/query.c +++ b/calendar/pcs/query.c @@ -1194,6 +1194,8 @@ process_components_cb (gpointer data) g_source_remove (priv->timeout_id); priv->timeout_id = 0; + bonobo_object_ref (BONOBO_OBJECT (query)); + while (priv->pending_uids) { g_assert (priv->n_pending > 0); @@ -1211,15 +1213,11 @@ process_components_cb (gpointer data) g_list_free_1 (l); - bonobo_object_ref (BONOBO_OBJECT (query)); - match_component (query, uid, TRUE, priv->pending_total - priv->n_pending, priv->pending_total); - bonobo_object_unref (BONOBO_OBJECT (query)); - g_free (uid); /* run the main loop, for not blocking */ @@ -1227,6 +1225,10 @@ process_components_cb (gpointer data) gtk_main_iteration (); } + bonobo_object_unref (BONOBO_OBJECT (query)); + if (!priv || !priv->ql) + return FALSE; + /* notify listener that the query ended */ priv->state = QUERY_DONE; -- cgit