Commit 8fcd25fd authored by Sam Thursfield's avatar Sam Thursfield

miners/fs: writeback_tasks table needs to ref its contents

This avoids critical errors like the following when writeback is running:

    (tracker-miner-fs:9195): GLib-GIO-CRITICAL **: g_file_equal: assertion 'G_IS_FILE (file1)' failed

The issue was that the GFile instances were being unreffed elsewhere and
invalidated, even though they still had entries in writeback_tasks.
parent 8d83449a
......@@ -505,7 +505,7 @@ tracker_miner_files_init (TrackerMinerFiles *mf)
priv->writeback_tasks = g_hash_table_new_full (g_file_hash,
(GEqualFunc) g_file_equal,
NULL, cancel_and_unref);
g_object_unref, cancel_and_unref);
priv->extract_check_cancellable = g_cancellable_new ();
......@@ -3618,7 +3618,7 @@ tracker_miner_files_writeback_file (TrackerMinerFiles *mf,
if (!g_hash_table_contains (mf->private->writeback_tasks, file)) {
cancellable = g_cancellable_new ();
g_hash_table_insert (mf->private->writeback_tasks, file, cancellable);
g_hash_table_insert (mf->private->writeback_tasks, g_object_ref (file), cancellable);
sync_writeback_pause_state (mf);
g_signal_emit (mf, signals[WRITEBACK], 0, file, rdf_types,
results, cancellable);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment