summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-29 13:02:34 +0100
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-29 13:02:34 +0100
commit6163467b9e155238b37e903816c93ae99a6b4b13 (patch)
treec547ca69951c1420034384a6d2ccf740823c5512
parentef9a41a48267e00d9f32e9ac42f858a4f8e25379 (diff)
downloadtelepathy-logger-6163467b9e155238b37e903816c93ae99a6b4b13.tar.gz
avoid calling purge_entry_timeout: after the store has been destroyed
-rw-r--r--telepathy-logger/log-store-sqlite.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/telepathy-logger/log-store-sqlite.c b/telepathy-logger/log-store-sqlite.c
index d38a8b6..3d5bc68 100644
--- a/telepathy-logger/log-store-sqlite.c
+++ b/telepathy-logger/log-store-sqlite.c
@@ -67,6 +67,8 @@ typedef struct _TplLogStoreSqlitePrivate TplLogStoreSqlitePrivate;
struct _TplLogStoreSqlitePrivate
{
sqlite3 *db;
+
+ guint purge_id;
};
static GObject *singleton = NULL;
@@ -160,6 +162,12 @@ tpl_log_store_sqlite_dispose (GObject *self)
priv->db = NULL;
}
+ if (priv->purge_id != 0)
+ {
+ g_source_remove (priv->purge_id);
+ priv->purge_id = 0;
+ }
+
G_OBJECT_CLASS (_tpl_log_store_sqlite_parent_class)->dispose (self);
}
@@ -231,7 +239,7 @@ _tpl_log_store_sqlite_init (TplLogStoreSqlite *self)
}
/* purge old entries every hour (60*60 secs) and purges 24h old entries */
- g_timeout_add_seconds (60*60, purge_entry_timeout, self);
+ priv->purge_id = g_timeout_add_seconds (60*60, purge_entry_timeout, self);
/* end of cache table init */