diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2020-06-27 10:44:49 +1200 |
---|---|---|
committer | Robert Ancell <robert.ancell@gmail.com> | 2020-09-22 21:23:05 +0000 |
commit | b25db4f6016043ebfdd105c7c6cec496a626beb9 (patch) | |
tree | c3607b28a69243fec9807184b97b5fd66ad1d46b | |
parent | f42d7cca9ac02d9f9fe428b8bbb945993835b6cf (diff) | |
download | gnome-control-center-b25db4f6016043ebfdd105c7c6cec496a626beb9.tar.gz |
printers: Don't pass PpJob references around
An internal GTask will hold a reference to it for the duration of the async calls.
-rw-r--r-- | panels/printers/cc-printers-panel.c | 4 |
1 files 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, |