[tracker] Fixed a crash in init of removable devices



commit 262288c407bf72edd5b4b19b1063ff9f45c889ba
Author: Philip Van Hoof <philip codeminded be>
Date:   Tue Sep 8 11:04:21 2009 +0200

    Fixed a crash in init of removable devices
    
    The initialize_removable_devices function gets a list of paths which it passed
    to tracker_miner_fs_add_directory, which in turn wants a GFile instance. The
    fix converts the path to a GFile before calling the latter function.

 src/tracker-miner-fs/tracker-miner-files.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/tracker-miner-fs/tracker-miner-files.c b/src/tracker-miner-fs/tracker-miner-files.c
index 33d0408..ab781b3 100644
--- a/src/tracker-miner-fs/tracker-miner-files.c
+++ b/src/tracker-miner-fs/tracker-miner-files.c
@@ -394,9 +394,11 @@ initialize_removable_devices (TrackerMinerFiles *mf)
                 mounts = tracker_storage_get_removable_device_roots (priv->storage);
 
                 for (m = mounts; m; m = m->next) {
-                        tracker_miner_fs_add_directory (TRACKER_MINER_FS (mf),
-							m->data, 
+			GFile *as_file = g_file_new_for_path (m->data);
+			tracker_miner_fs_add_directory (TRACKER_MINER_FS (mf),
+							as_file, 
 							TRUE);
+			g_object_unref (as_file);
                 }
         }
 }



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