From: Jens Georg Date: Tue, 18 Jan 2011 19:33:07 +0000 (+0100) Subject: core: Prevent possible crash on Ctrl-C X-Git-Tag: RYGEL_0_9_7~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=13c124588b9775b057d61efe223521c409e2d3cc;p=profile%2Fivi%2Frygel.git core: Prevent possible crash on Ctrl-C --- diff --git a/src/rygel/rygel-main.vala b/src/rygel/rygel-main.vala index 1753c2b..f729c5b 100644 --- a/src/rygel/rygel-main.vala +++ b/src/rygel/rygel-main.vala @@ -187,9 +187,14 @@ public class Rygel.Main : Object { device.available = plugin.active && this.config.get_upnp_enabled (); - this.root_devices.add (device); + // Due to pure evilness of unix sinals this might actually happen + // if someone shuts down rygel while the call-back is running, + // leading to a crash on shutdown + if (this.root_devices != null) { + this.root_devices.add (device); - plugin.notify["active"].connect (this.on_plugin_active_notify); + plugin.notify["active"].connect (this.on_plugin_active_notify); + } } catch (GLib.Error error) { warning (_("Failed to create RootDevice for %s. Reason: %s"), plugin.name,