diff options
author | Timm Bäder <mail@baedert.org> | 2016-04-23 16:06:01 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2016-06-20 12:39:44 +0200 |
commit | 5c98143086a37b728ac187a934028e650d1a6c0f (patch) | |
tree | fbd8e634a523f7b81df68ba6b2657f63dadb68d3 /rest/rest-proxy-call.c | |
parent | 4ea1fca79b719d5f7c5458d96bce9b62a762c715 (diff) | |
download | librest-5c98143086a37b728ac187a934028e650d1a6c0f.tar.gz |
RestProxy(Call): Simplify _dispose
Diffstat (limited to 'rest/rest-proxy-call.c')
-rw-r--r-- | rest/rest-proxy-call.c | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/rest/rest-proxy-call.c b/rest/rest-proxy-call.c index 7abf367..4a5425a 100644 --- a/rest/rest-proxy-call.c +++ b/rest/rest-proxy-call.c @@ -144,29 +144,10 @@ rest_proxy_call_dispose (GObject *object) g_clear_object (&priv->cancellable); } - if (priv->params) - { - rest_params_free (priv->params); - priv->params = NULL; - } - - if (priv->headers) - { - g_hash_table_unref (priv->headers); - priv->headers = NULL; - } - - if (priv->response_headers) - { - g_hash_table_unref (priv->response_headers); - priv->response_headers = NULL; - } - - if (priv->proxy) - { - g_object_unref (priv->proxy); - priv->proxy = NULL; - } + g_clear_pointer (&priv->params, rest_params_free); + g_clear_pointer (&priv->headers, g_hash_table_unref); + g_clear_pointer (&priv->response_headers, g_hash_table_unref); + g_clear_object (&priv->proxy); G_OBJECT_CLASS (rest_proxy_call_parent_class)->dispose (object); } |