Simplify use of GCancellable

g_cancellable_cancell can be called without checking for a NULL value.
Use g_clear_object instead of g_object_unref
This commit is contained in:
Robert Ancell 2018-05-31 10:16:54 +12:00 committed by Georges Basile Stavracas Neto
parent dd61d98ec5
commit a64ef75ad7
9 changed files with 23 additions and 54 deletions

View file

@ -267,8 +267,7 @@ net_object_finalize (GObject *object)
g_free (priv->id);
g_free (priv->title);
if (priv->cancellable != NULL)
g_object_unref (priv->cancellable);
g_clear_object (&priv->cancellable);
if (priv->client)
g_object_remove_weak_pointer (G_OBJECT (priv->client), (gpointer *) (&priv->client));