summaryrefslogtreecommitdiff
path: root/src/libtracker-miner/tracker-task-pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libtracker-miner/tracker-task-pool.c')
-rw-r--r--src/libtracker-miner/tracker-task-pool.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libtracker-miner/tracker-task-pool.c b/src/libtracker-miner/tracker-task-pool.c
index f66d4b694..c17d961be 100644
--- a/src/libtracker-miner/tracker-task-pool.c
+++ b/src/libtracker-miner/tracker-task-pool.c
@@ -218,11 +218,22 @@ tracker_task_pool_add (TrackerTaskPool *pool,
TrackerTask *task)
{
TrackerTaskPoolPrivate *priv;
+ GFile *file;
g_return_if_fail (TRACKER_IS_TASK_POOL (pool));
priv = pool->priv;
+ file = tracker_task_get_file (task);
+
+ if (g_hash_table_contains (priv->tasks, file)) {
+ /* This is bad! We use the task's associated GFile as the key for the
+ * hash table, so if there's already a value we are about to overwrite
+ * it. This suggests there's a bug in the tracker-miner-fs.c code.
+ */
+ g_warning ("Multiple update tasks for file %s", g_file_get_uri (file));
+ };
+
g_hash_table_insert (priv->tasks,
tracker_task_get_file (task),
tracker_task_ref (task));