[gnome-control-center] printers: Ensure PPD copy is always deleted



commit 2ee5f1422aed5b17b91280cc9ab065233be495d9
Author: Robert Ancell <robert ancell canonical com>
Date:   Fri Feb 12 15:25:20 2021 +1300

    printers: Ensure PPD copy is always deleted

 panels/printers/pp-utils.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/panels/printers/pp-utils.c b/panels/printers/pp-utils.c
index 9d4f7723b..7a94745a0 100644
--- a/panels/printers/pp-utils.c
+++ b/panels/printers/pp-utils.c
@@ -1436,7 +1436,11 @@ static void
 psp_data_free (PSPData *data)
 {
   g_free (data->printer_name);
-  g_free (data->ppd_copy);
+  if (data->ppd_copy != NULL)
+    {
+      g_unlink (data->ppd_copy);
+      g_free (data->ppd_copy);
+    }
   g_clear_object (&data->cancellable);
   g_free (data);
 }
@@ -1479,12 +1483,6 @@ printer_set_ppd_async_dbus_cb (GObject      *source_object,
     data->callback (data->printer_name,
                     result,
                     data->user_data);
-
-  if (data->ppd_copy)
-    {
-      g_unlink (data->ppd_copy);
-      g_free (data->ppd_copy);
-    }
 }
 
 /*


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