From c3251f7178687dc0144720f4ca648339f1960635 Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Tue, 5 Jun 2012 11:24:17 +0300 Subject: [PATCH] config: No service removal on cleanup We must not remove the services when connman is stopped. --- src/config.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/config.c b/src/config.c index 6af979d..b304645 100644 --- a/src/config.c +++ b/src/config.c @@ -68,6 +68,7 @@ static int inotify_wd = -1; static GIOChannel *inotify_channel = NULL; static uint inotify_watch = 0; +static connman_bool_t cleanup = FALSE; #define INTERNAL_CONFIG_PREFIX "__internal" @@ -133,6 +134,9 @@ static void unregister_service(gpointer data) char *service_id; GSList *list; + if (cleanup == TRUE) + goto free_only; + connman_info("Removing service configuration %s", config_service->ident); @@ -154,6 +158,7 @@ static void unregister_service(gpointer data) service_id); } +free_only: g_free(config_service->ident); g_free(config_service->type); g_free(config_service->name); @@ -712,10 +717,14 @@ void __connman_config_cleanup(void) { DBG(""); + cleanup = TRUE; + remove_watch(); g_hash_table_destroy(config_table); config_table = NULL; + + cleanup = FALSE; } static char *config_pem_fsid(const char *pem_file) -- 2.7.4