aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-datetime.c
diff options
context:
space:
mode:
authorLuke Yelavich <luke.yelavich@canonical.com>2011-02-17 11:05:35 +1100
committerLuke Yelavich <luke.yelavich@canonical.com>2011-02-17 11:05:35 +1100
commit4bc78d5d1b25f514828a0fb9652f65e529a4e7cf (patch)
tree3eace5946892526e8e7d99e862b9e936180e421e /src/indicator-datetime.c
parent5b018bfff889c44eef34cc8aed95c36dbce25543 (diff)
downloadayatana-indicator-datetime-4bc78d5d1b25f514828a0fb9652f65e529a4e7cf.tar.gz
ayatana-indicator-datetime-4bc78d5d1b25f514828a0fb9652f65e529a4e7cf.tar.bz2
ayatana-indicator-datetime-4bc78d5d1b25f514828a0fb9652f65e529a4e7cf.zip
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.
Diffstat (limited to 'src/indicator-datetime.c')
-rw-r--r--src/indicator-datetime.c8
1 files 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;
}