aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog6
-rw-r--r--calendar/pcs/query.c10
2 files changed, 12 insertions, 4 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index de08d34644..91803e672f 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,9 @@
+2002-06-03 Rodrigo Moya <rodrigo@ximian.com>
+
+ * pcs/query.c: keep a reference to the Query object, to avoid
+ crashes when the queries are destroyed before finishing processing.
+ Fixes #25056.
+
2002-05-26 JP Rosevear <jpr@ximian.com>
* gui/dialogs/comp-editor.h: update proto
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;