[gupnp] [PATCH 2/2] Remove server handlers on dispose
- From: Sven Neumann <s neumann raumfeld com>
- To: gupnp o-hand com
- Cc: Sven Neumann <s neumann raumfeld com>
- Subject: [gupnp] [PATCH 2/2] Remove server handlers on dispose
- Date: Wed, 2 Jun 2010 17:11:31 +0200
GUPnPService should remove all handlers installed on the
shared SoupServer instance when it is disposed.
Signed-off-by: Sven Neumann <s neumann raumfeld com>
---
libgupnp/gupnp-service.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/libgupnp/gupnp-service.c b/libgupnp/gupnp-service.c
index 40c6964..9527707 100644
--- a/libgupnp/gupnp-service.c
+++ b/libgupnp/gupnp-service.c
@@ -1511,9 +1511,33 @@ gupnp_service_dispose (GObject *object)
{
GUPnPService *service;
GObjectClass *object_class;
+ GUPnPServiceInfo *info;
+ GUPnPContext *context;
+ SoupServer *server;
+ char *url;
+ char *path;
service = GUPNP_SERVICE (object);
+ /* Get server */
+ info = GUPNP_SERVICE_INFO (service);
+ context = gupnp_service_info_get_context (info);
+ server = gupnp_context_get_server (context);
+
+ /* Remove listener on controlURL */
+ url = gupnp_service_info_get_control_url (info);
+ path = path_from_url (url);
+ soup_server_remove_handler (server, path);
+ g_free (path);
+ g_free (url);
+
+ /* Remove listener on eventSubscriptionURL */
+ url = gupnp_service_info_get_event_subscription_url (info);
+ path = path_from_url (url);
+ soup_server_remove_handler (server, path);
+ g_free (path);
+ g_free (url);
+
if (service->priv->root_device) {
GUPnPRootDevice **dev = &(service->priv->root_device);
--
1.7.0.4
--
To unsubscribe send a mail to gupnp+unsubscribe\@o-hand.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]