summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2014-05-25 09:44:21 +0200
committerJens Georg <mail@jensge.org>2014-05-25 09:45:52 +0200
commitbb6fbdd3272de42a2621adf563b60abc6960f235 (patch)
tree69859eb04aee3e11181b2eb3697bb3992500818e
parentbaa0fa58903e22548add4f77be83064393991c35 (diff)
downloadgupnp-bb6fbdd3272de42a2621adf563b60abc6960f235.tar.gz
Prevent dangling pointer
Regression introduced with 8abfa8082997bf59cd20aba2bd86de0eb3f88279 - _dispose might be called multiple times, so g_list_free_full might have been called on an already freed list - emit_notifications left a dangling pointer which caused _dispose to crash Signed-off-by: Jens Georg <mail@jensge.org>
-rw-r--r--libgupnp/gupnp-service-proxy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libgupnp/gupnp-service-proxy.c b/libgupnp/gupnp-service-proxy.c
index 0d8868a..d1d1c6a 100644
--- a/libgupnp/gupnp-service-proxy.c
+++ b/libgupnp/gupnp-service-proxy.c
@@ -296,6 +296,7 @@ gupnp_service_proxy_dispose (GObject *object)
g_list_free_full (proxy->priv->pending_notifies,
(GDestroyNotify) emit_notify_data_free);
+ proxy->priv->pending_notifies = NULL;
/* Call super */
object_class = G_OBJECT_CLASS (gupnp_service_proxy_parent_class);
@@ -1865,6 +1866,7 @@ emit_notifications (gpointer user_data)
/* Cleanup */
g_list_free_full (proxy->priv->pending_notifies,
(GDestroyNotify) emit_notify_data_free);
+ proxy->priv->pending_notifies = NULL;
proxy->priv->notify_idle_src = NULL;