[gupnp] [PATCH] Fix potential crash in resource-unavailable()



Similar fix as for resource_expire(), emit the "resource-unavailable"
signal after having removed the resource from the list of available
resources.
---
 libgssdp/gssdp-resource-browser.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libgssdp/gssdp-resource-browser.c b/libgssdp/gssdp-resource-browser.c
index fb54dbd..7d98c1e 100644
--- a/libgssdp/gssdp-resource-browser.c
+++ b/libgssdp/gssdp-resource-browser.c
@@ -778,12 +778,12 @@ resource_unavailable (GSSDPResourceBrowser *resource_browser,
         if (!g_hash_table_lookup (resource_browser->priv->resources, usn))
                 return;
 
+        g_hash_table_remove (resource_browser->priv->resources, usn);
+
         g_signal_emit (resource_browser,
                        signals[RESOURCE_UNAVAILABLE],
                        0,
                        usn);
-
-        g_hash_table_remove (resource_browser->priv->resources, usn);
 }
 
 static gboolean
-- 
1.7.2.3

--
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]