[gnome-settings-daemon] housekeeping: Make purging work



commit b5480bf916bd5cabd75adc3244f86c1bdbe256a3
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 5 16:08:11 2013 -0500

    housekeeping: Make purging work
    
    When the recursive deletion code was turned async, this broke.

 plugins/housekeeping/gsd-disk-space.c |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)
---
diff --git a/plugins/housekeeping/gsd-disk-space.c b/plugins/housekeeping/gsd-disk-space.c
index 469bcba..5ad264d 100644
--- a/plugins/housekeeping/gsd-disk-space.c
+++ b/plugins/housekeeping/gsd-disk-space.c
@@ -458,27 +458,24 @@ gsd_ldsm_purge_temp_files (GDateTime *old)
         file = g_file_new_for_path (g_get_tmp_dir ());
         data = delete_data_new (file, NULL, old, FALSE, FALSE, 0);
         delete_recursively_by_age (data);
+        delete_data_unref (data);
+        g_object_unref (file);
 
         if (g_strcmp0 (g_get_tmp_dir (), "/var/tmp") != 0) {
-                g_assert (data->ref_count == 1);
-                g_assert (data->depth == 0);
-                g_object_unref (data->file);
-                data->file = g_file_new_for_path ("/var/tmp");
-                data->depth = 0;
+                file = g_file_new_for_path ("/var/tmp");
+                data = delete_data_new (file, NULL, old, FALSE, FALSE, 0);
                 delete_recursively_by_age (data);
+                delete_data_unref (data);
+                g_object_unref (file);
         }
 
         if (g_strcmp0 (g_get_tmp_dir (), "/tmp") != 0) {
-                g_assert (data->ref_count == 1);
-                g_assert (data->depth == 0);
-                g_object_unref (data->file);
-                data->file = g_file_new_for_path ("/tmp");
-                data->depth = 0;
+                file = g_file_new_for_path ("/tmp");
+                data = delete_data_new (file, NULL, old, FALSE, FALSE, 0);
                 delete_recursively_by_age (data);
+                delete_data_unref (data);
+                g_object_unref (file);
         }
-
-        delete_data_unref (data);
-        g_object_unref (file);
 }
 
 void



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