Fix issue introduced with commit 20dce239
authorSven Neumann <s.neumann@raumfeld.com>
Thu, 16 Dec 2010 13:41:21 +0000 (14:41 +0100)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 16 Dec 2010 16:28:33 +0000 (18:28 +0200)
The Reource struct is not any longer valid at the point we emit the
signal, so better not access it there.

libgssdp/gssdp-resource-browser.c

index 7d98c1e..10f7301 100644 (file)
@@ -580,10 +580,12 @@ gssdp_resource_browser_get_active (GSSDPResourceBrowser *resource_browser)
 static gboolean
 resource_expire (gpointer user_data)
 {
+        GSSDPResourceBrowser *resource_browser;
         Resource *resource;
         char *usn;
 
         resource = user_data;
+        resource_browser = resource->resource_browser;
 
         /* Steal the USN pointer from the resource as we need it for the signal
          * emission.
@@ -593,7 +595,7 @@ resource_expire (gpointer user_data)
 
         g_hash_table_remove (resource->resource_browser->priv->resources, usn);
 
-        g_signal_emit (resource->resource_browser,
+        g_signal_emit (resource_browser,
                        signals[RESOURCE_UNAVAILABLE],
                        0,
                        usn);