aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-model.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/calendar-model.c')
-rw-r--r--calendar/gui/calendar-model.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c
index 94221fdd61..43195071f0 100644
--- a/calendar/gui/calendar-model.c
+++ b/calendar/gui/calendar-model.c
@@ -1897,6 +1897,7 @@ static void
update_query (CalendarModel *model)
{
CalendarModelPrivate *priv;
+ CalQuery *old_query;
char *real_sexp;
priv = model->priv;
@@ -1909,9 +1910,12 @@ update_query (CalendarModel *model)
&& cal_client_get_load_state (priv->client) == CAL_CLIENT_LOAD_LOADED))
return;
- if (priv->query) {
- gtk_signal_disconnect_by_data (GTK_OBJECT (priv->query), model);
- gtk_object_unref (GTK_OBJECT (priv->query));
+ old_query = priv->query;
+ priv->query = NULL;
+
+ if (old_query) {
+ gtk_signal_disconnect_by_data (GTK_OBJECT (old_query), model);
+ gtk_object_unref (GTK_OBJECT (old_query));
}
g_assert (priv->sexp != NULL);