summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2012-04-28 18:48:37 +0200
committerJens Georg <mail@jensge.org>2012-04-28 20:42:11 +0200
commit09c399d3534a2b586b673ea03a3543e4790315dc (patch)
treef7803f083bcd037d19a6564daf7632c2e0e7cbd2
parent684737f1f7f6869d5e9c3c790e91d32125deb41e (diff)
downloadrygel-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.vala14
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;