Fix potential crash in resource-unavailable()
authorSven Neumann <s.neumann@raumfeld.com>
Thu, 18 Nov 2010 21:33:49 +0000 (22:33 +0100)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Mon, 22 Nov 2010 13:41:35 +0000 (15:41 +0200)
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

index fb54dbd..7d98c1e 100644 (file)
@@ -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