aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Terry <michael.terry@canonical.com>2011-07-14 10:26:01 -0400
committerMichael Terry <michael.terry@canonical.com>2011-07-14 10:26:01 -0400
commita1d4564883ff1020d4de28343550b827c1b803c6 (patch)
treee6b19191f0eda49b5ca7fa99f2b321036e03a5cf
parent51c6800c6f718c07bd0cd016a5acdf5652f7e9c4 (diff)
downloadayatana-indicator-datetime-a1d4564883ff1020d4de28343550b827c1b803c6.tar.gz
ayatana-indicator-datetime-a1d4564883ff1020d4de28343550b827c1b803c6.tar.bz2
ayatana-indicator-datetime-a1d4564883ff1020d4de28343550b827c1b803c6.zip
don't unref a NULL GDateTime object; original patch by Dave Gilbert
-rw-r--r--src/indicator-datetime.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 072253b..163804b 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -829,11 +829,13 @@ update_label (IndicatorDatetime * io, GDateTime ** datetime)
static void
update_time (IndicatorDatetime * self)
{
- GDateTime * dt;
+ GDateTime * dt = NULL;
update_label(self, &dt);
timezone_update_all_labels(self);
- setup_timer(self, dt);
- g_date_time_unref(dt);
+ if (dt != NULL) {
+ setup_timer(self, dt);
+ g_date_time_unref(dt);
+ }
return;
}
@@ -857,11 +859,13 @@ timer_func (gpointer user_data)
{
IndicatorDatetime * self = INDICATOR_DATETIME(user_data);
self->priv->timer = 0;
- GDateTime * dt;
+ GDateTime * dt = NULL;
update_label(self, &dt);
timezone_update_all_labels(self);
- setup_timer(self, dt);
- g_date_time_unref(dt);
+ if (dt != NULL) {
+ setup_timer(self, dt);
+ g_date_time_unref(dt);
+ }
return FALSE;
}