Skip to content

printers: Do not cleanup task after getting bus

With the g_autoptr() on task in get_bus_cb() it happened that the task was passed as user_data to the g_dbus_connection_call() but the pointer was dereferenced at the end of the function which led to invalidated pointer and warnings like:

(gnome-control-center:15182): GLib-GIO-CRITICAL **: 17:00:58.664: g_task_get_source_object: assertion 'G_IS_TASK (task)' failed.

This merge request uses g_steal_pointer() on task in get_bus_cb() in pp-printer.c to not invalidate a the pointer and also cleans the task in callback of the DBus call (printer_rename_dbus_cb()). The g_steal_pointer() is not used directly when passing the pointer but later so that the local pointer is not set to NULL when evaluating other arguments of the DBus call.

Merge request reports