[gnome-control-center] printers: Don't pass PpJob references around



commit b25db4f6016043ebfdd105c7c6cec496a626beb9
Author: Robert Ancell <robert ancell canonical com>
Date:   Sat Jun 27 10:44:49 2020 +1200

    printers: Don't pass PpJob references around
    
    An internal GTask will hold a reference to it for the duration of the async calls.

 panels/printers/cc-printers-panel.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/panels/printers/cc-printers-panel.c b/panels/printers/cc-printers-panel.c
index 5d3fb3730..b793931f3 100644
--- a/panels/printers/cc-printers-panel.c
+++ b/panels/printers/cc-printers-panel.c
@@ -354,7 +354,6 @@ on_get_job_attributes_cb (GObject      *source_object,
   g_autoptr(GError)       error = NULL;
 
   attributes = pp_job_get_attributes_finish (PP_JOB (source_object), res, &error);
-  g_object_unref (source_object);
 
   if (attributes != NULL)
     {
@@ -402,7 +401,6 @@ on_cups_notification (GDBusConnection *connection,
   gchar                  *text = NULL;
   gchar                  *printer_uri = NULL;
   gchar                  *printer_state_reasons = NULL;
-  PpJob                  *job;
   gchar                  *job_state_reasons = NULL;
   gchar                  *job_name = NULL;
   guint                   job_id;
@@ -458,6 +456,8 @@ on_cups_notification (GDBusConnection *connection,
   else if (g_strcmp0 (signal_name, "JobCreated") == 0 ||
            g_strcmp0 (signal_name, "JobCompleted") == 0)
     {
+      g_autoptr(PpJob) job = NULL;
+
       job = g_object_new (PP_TYPE_JOB, "id", job_id, NULL);
       pp_job_get_attributes_async (job,
                                    requested_attrs,


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