[tracker] TrackerMinerFiles: Fix potential crash when cancelling extraction.



commit c0580a3959439ca2105db5f7b0ee520594eca887
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Mar 26 13:30:14 2010 +0100

    TrackerMinerFiles: Fix potential crash when cancelling extraction.
    
    the GCancellable in use may outlive ProcessFileData, and be also reused.
    So when cancelled it would also trigger cancelling on no longer valid
    data.

 src/miners/fs/tracker-miner-files.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-files.c b/src/miners/fs/tracker-miner-files.c
index 668260f..061b67f 100644
--- a/src/miners/fs/tracker-miner-files.c
+++ b/src/miners/fs/tracker-miner-files.c
@@ -150,6 +150,9 @@ static gboolean    miner_files_ignore_next_update_file  (TrackerMinerFS       *f
                                                          GFile                *file,
                                                          TrackerSparqlBuilder *sparql,
                                                          GCancellable         *cancellable);
+static void      extractor_get_embedded_metadata_cancel (GCancellable    *cancellable,
+                                                         ProcessFileData *data);
+
 
 G_DEFINE_TYPE (TrackerMinerFiles, tracker_miner_files, TRACKER_TYPE_MINER_FS)
 
@@ -1313,6 +1316,10 @@ miner_files_add_to_datasource (TrackerMinerFiles    *mf,
 static void
 process_file_data_free (ProcessFileData *data)
 {
+	g_signal_handlers_disconnect_by_func (data->cancellable,
+	                                      extractor_get_embedded_metadata_cancel,
+	                                      data);
+
 	g_object_unref (data->miner);
 	g_object_unref (data->sparql);
 	g_object_unref (data->cancellable);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]