From 4bc78d5d1b25f514828a0fb9652f65e529a4e7cf Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Thu, 17 Feb 2011 11:05:35 +1100 Subject: Get the indicator entry data into a separate variable, adn and free it after we signal a change in the accessible description, to avoid a memory leak. --- src/indicator-datetime.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 0d76a48..38050f9 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -610,6 +610,7 @@ static struct tm * update_label (IndicatorDatetime * io) { IndicatorDatetime * self = INDICATOR_DATETIME(io); + GList * entry = indicator_object_get_entries(INDICATOR_OBJECT(io)); if (self->priv->label == NULL) return NULL; @@ -623,11 +624,13 @@ update_label (IndicatorDatetime * io) if (ltime == NULL) { g_debug("Error getting local time"); gtk_label_set_label(self->priv->label, _("Error getting time")); + g_signal_emit(G_OBJECT(self), INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, 0, - (IndicatorObjectEntry *)indicator_object_get_entries(INDICATOR_OBJECT(self))->data, + entry->data, TRUE); + g_list_free(entry); return NULL; } @@ -652,8 +655,9 @@ update_label (IndicatorDatetime * io) g_signal_emit(G_OBJECT(self), INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, 0, - (IndicatorObjectEntry *)indicator_object_get_entries(INDICATOR_OBJECT(self))->data, + entry->data, TRUE); + g_list_free(entry); return ltime; } -- cgit v1.2.3