[liboobs/gnome-2-30: 1/2] Clear runlevels list before updating
- From: Milan Bouchet-Valat <milanbv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [liboobs/gnome-2-30: 1/2] Clear runlevels list before updating
- Date: Tue, 18 May 2010 17:21:30 +0000 (UTC)
commit 032aafa45a7e6aa7ea2823ed6629873b7bf150cc
Author: Milan Bouchet-Valat <nalimilan club fr>
Date: Mon May 3 22:34:24 2010 +0200
Clear runlevels list before updating
Before that, we were adding the 6 runlevels again and again, on each update. This lead to bugs when committing services changes, because only the first occurrence was modified, and others were always set to 'stop'. Since each runlevel was committed several times, the last one was deciding of the final state of the service, which was 'stop'.
The only known symptom of this was in time-admin, which is updating the services list when installing NTP support. See
https://bugs.launchpad.net/ubuntu/+source/gnome-system-tools/+bug/551936
oobs/oobs-servicesconfig.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/oobs/oobs-servicesconfig.c b/oobs/oobs-servicesconfig.c
index ced5e1c..0b162f8 100644
--- a/oobs/oobs-servicesconfig.c
+++ b/oobs/oobs-servicesconfig.c
@@ -147,6 +147,13 @@ create_runlevels_list_from_dbus_reply (OobsObject *object,
priv = OOBS_SERVICES_CONFIG (object)->_priv;
+ if (priv->runlevels)
+ {
+ g_list_foreach (priv->runlevels, (GFunc) free_runlevel, NULL);
+ g_list_free (priv->runlevels);
+ priv->runlevels = NULL;
+ }
+
while (dbus_message_iter_get_arg_type (&iter) == DBUS_TYPE_STRING)
{
name = utils_get_string (&iter);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]