diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2020-10-30 11:41:49 +1300 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2020-10-30 11:42:14 +1300 |
commit | ad226b420c656a055602136ff1feaa6ba919d039 (patch) | |
tree | afbc722da8ebc8acb3ad59b6b87a8f5260f90e83 | |
parent | 902f90e5eacb6462fd604b45d4a8ae908fd72c75 (diff) | |
download | gnome-control-center-ad226b420c656a055602136ff1feaa6ba919d039.tar.gz |
printers: Use g_autoptr with GThread
-rw-r--r-- | panels/printers/pp-utils.c | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/panels/printers/pp-utils.c b/panels/printers/pp-utils.c index ef11053e1..f496fa7fb 100644 --- a/panels/printers/pp-utils.c +++ b/panels/printers/pp-utils.c @@ -1335,7 +1335,7 @@ get_ipp_attributes_async (const gchar *printer_name, gpointer user_data) { GIAData *data; - GThread *thread; + g_autoptr(GThread) thread = NULL; g_autoptr(GError) error = NULL; data = g_new0 (GIAData, 1); @@ -1357,10 +1357,6 @@ get_ipp_attributes_async (const gchar *printer_name, get_ipp_attributes_data_free (data); } - else - { - g_thread_unref (thread); - } } IPPAttribute * @@ -1734,7 +1730,7 @@ get_ppds_attribute_async (gchar **ppds_names, gpointer user_data) { GPAData *data; - GThread *thread; + g_autoptr(GThread) thread = NULL; g_autoptr(GError) error = NULL; if (!ppds_names || !attribute_name) @@ -1762,10 +1758,6 @@ get_ppds_attribute_async (gchar **ppds_names, get_ppds_attribute_data_free (data); } - else - { - g_thread_unref (thread); - } } @@ -2718,8 +2710,8 @@ get_all_ppds_async (GCancellable *cancellable, gpointer user_data) { GAPData *data; - GThread *thread; - g_autoptr(GError) error = NULL; + g_autoptr(GThread) thread; + g_autoptr(GError) error = NULL; data = g_new0 (GAPData, 1); if (cancellable) @@ -2740,10 +2732,6 @@ get_all_ppds_async (GCancellable *cancellable, get_all_ppds_data_free (data); } - else - { - g_thread_unref (thread); - } } PPDList * @@ -2926,7 +2914,7 @@ printer_get_ppd_async (const gchar *printer_name, gpointer user_data) { PGPData *data; - GThread *thread; + g_autoptr(GThread) thread = NULL; g_autoptr(GError) error = NULL; data = g_new0 (PGPData, 1); @@ -2949,10 +2937,6 @@ printer_get_ppd_async (const gchar *printer_name, printer_get_ppd_data_free (data); } - else - { - g_thread_unref (thread); - } } typedef struct @@ -3018,7 +3002,7 @@ get_named_dest_async (const gchar *printer_name, gpointer user_data) { GNDData *data; - GThread *thread; + g_autoptr(GThread) thread = NULL; g_autoptr(GError) error = NULL; data = g_new0 (GNDData, 1); @@ -3039,10 +3023,6 @@ get_named_dest_async (const gchar *printer_name, get_named_dest_data_free (data); } - else - { - g_thread_unref (thread); - } } typedef struct |