diff options
author | Jonathon Jongsma <jonathon.jongsma@collabora.co.uk> | 2010-05-27 17:17:19 -0500 |
---|---|---|
committer | Ross Burton <ross@linux.intel.com> | 2010-05-28 10:28:13 +0100 |
commit | f82c9af4e1bae1dfd1548d09a85d6f5d975fcbc4 (patch) | |
tree | ada186764d72f289c493184714af0ac409020c3a /rest/rest-proxy.c | |
parent | cc1c3fda9fb781eb50623ecf8aa5d246a13ff279 (diff) | |
download | librest-f82c9af4e1bae1dfd1548d09a85d6f5d975fcbc4.tar.gz |
Fix leak of soup logger instances
When adding a feature, the soup session takes a reference on the feature, so we
need to unref it after adding in order for it not to leak.
http://bugs.meego.com/show_bug.cgi?id=2500
Diffstat (limited to 'rest/rest-proxy.c')
-rw-r--r-- | rest/rest-proxy.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/rest/rest-proxy.c b/rest/rest-proxy.c index a59b260..19b41df 100644 --- a/rest/rest-proxy.c +++ b/rest/rest-proxy.c @@ -223,10 +223,13 @@ rest_proxy_init (RestProxy *self) #endif if (REST_DEBUG_ENABLED(PROXY)) { - soup_session_add_feature - (priv->session, (SoupSessionFeature*)soup_logger_new (SOUP_LOGGER_LOG_BODY, 0)); - soup_session_add_feature - (priv->session_sync, (SoupSessionFeature*)soup_logger_new (SOUP_LOGGER_LOG_BODY, 0)); + SoupSessionFeature *logger = (SoupSessionFeature*)soup_logger_new (SOUP_LOGGER_LOG_BODY, 0); + soup_session_add_feature (priv->session, logger); + g_object_unref (logger); + + logger = (SoupSessionFeature*)soup_logger_new (SOUP_LOGGER_LOG_BODY, 0); + soup_session_add_feature (priv->session_sync, logger); + g_object_unref (logger); } } |