diff options
author | Jens Georg <mail@jensge.org> | 2014-05-24 17:53:14 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2014-05-24 17:59:31 +0200 |
commit | c186160360358eeee069766bcf65447996cf6e25 (patch) | |
tree | be781b65b1bd2aa850d9694dd44b71d9d46789d0 | |
parent | 1455e2bb962ccb7d2d62f53eaabb917c336f6fae (diff) | |
download | gupnp-c186160360358eeee069766bcf65447996cf6e25.tar.gz |
Don't leak CallbackData
If a ServiceProxy was unref'ed with notifies still added, callback data
would be leaked.
Signed-off-by: Jens Georg <mail@jensge.org>
https://bugzilla.gnome.org/show_bug.cgi?id=730690
-rw-r--r-- | libgupnp/gupnp-service-proxy.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c index ec76277..ed8cc6c 100644 --- a/libgupnp/gupnp-service-proxy.c +++ b/libgupnp/gupnp-service-proxy.c @@ -134,9 +134,16 @@ gupnp_service_proxy_action_free (GUPnPServiceProxyAction *action) } static void +callback_data_free (CallbackData *data) +{ + g_slice_free (CallbackData, data); +} + +static void notify_data_free (NotifyData *data) { - g_list_free (data->callbacks); + g_list_free_full (data->callbacks, + (GDestroyNotify) callback_data_free); g_slice_free (NotifyData, data); } |