diff options
author | Jens Georg <mail@jensge.org> | 2012-04-28 18:48:37 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2012-04-28 20:42:11 +0200 |
commit | 09c399d3534a2b586b673ea03a3543e4790315dc (patch) | |
tree | f7803f083bcd037d19a6564daf7632c2e0e7cbd2 | |
parent | 684737f1f7f6869d5e9c3c790e91d32125deb41e (diff) | |
download | rygel-09c399d3534a2b586b673ea03a3543e4790315dc.tar.gz |
ui: Remove autostart file first
Remove autostart file and disable option before trying to shut down a
running Rygel instance to prevent a shut-down failure leaving an
autostart file dangling around.
-rw-r--r-- | src/ui/rygel-writable-user-config.vala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ui/rygel-writable-user-config.vala b/src/ui/rygel-writable-user-config.vala index f0217f23..de6a4dc8 100644 --- a/src/ui/rygel-writable-user-config.vala +++ b/src/ui/rygel-writable-user-config.vala @@ -192,6 +192,13 @@ public class Rygel.WritableUserConfig : Rygel.UserConfig { this.set_bool ("general", UPNP_ENABLED_KEY, true); } else { // Stop service only if already running + // Then delete the symlink from user's autostart dir + try { + dest.delete (null); + } catch (IOError.NOT_FOUND err) {} + + this.set_bool ("general", UPNP_ENABLED_KEY, false); + if (this.is_upnp_enabled ()) { // Create proxy to Rygel DBusInterface rygel_proxy = Bus.get_proxy_sync @@ -202,13 +209,6 @@ public class Rygel.WritableUserConfig : Rygel.UserConfig { rygel_proxy.shutdown (); } - - // Then delete the symlink from user's autostart dir - try { - dest.delete (null); - } catch (IOError.NOT_FOUND err) {} - - this.set_bool ("general", UPNP_ENABLED_KEY, false); } } catch (GLib.Error err) { string message; |