From c18875c62369a65ff1ae315654e1b6a51c363173 Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Thu, 29 Oct 2020 17:14:31 +0100 Subject: [PATCH] printers: Do not cleanup task after getting bus Use g_steal_pointer() on task in get_bus_cb() in pp-printer.c to not invalidate a pointer passed to a DBus call. Cleanup the task in callback of the DBus call. --- panels/printers/pp-printer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panels/printers/pp-printer.c b/panels/printers/pp-printer.c index 70c580fde..fd478f9ad 100644 --- a/panels/printers/pp-printer.c +++ b/panels/printers/pp-printer.c @@ -152,7 +152,7 @@ printer_rename_dbus_cb (GObject *source_object, g_autoptr(GVariant) output = NULL; gboolean result = FALSE; g_autoptr(GError) error = NULL; - GTask *task = user_data; + g_autoptr(GTask) task = user_data; output = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source_object), res, @@ -227,6 +227,7 @@ get_bus_cb (GObject *source_object, g_task_get_cancellable (task), printer_rename_dbus_cb, task); + g_steal_pointer (&task); } else {