diff options
author | Marek Kasik <mkasik@redhat.com> | 2020-10-29 17:14:31 +0100 |
---|---|---|
committer | Marek Kasik <mkasik@redhat.com> | 2020-10-29 17:14:31 +0100 |
commit | 0f43ca4e6a9f97df8b886adfeeb8a20cde4ade11 (patch) | |
tree | c6555d6f557648a41cdf52484a57b66263e36aab | |
parent | 2def2718248cdc9d49f3d1eed289b898d6964944 (diff) | |
download | gnome-control-center-printers-Do-not-cleanup-task-after-getting-bus.tar.gz |
printers: Do not cleanup task after getting busprinters-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.
-rw-r--r-- | panels/printers/pp-printer.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 { |