From: Daniel Wagner <daniel.wag...@bmw-carit.de>

The core wants to call the destroy function from the plugin. Therefore
we need to move __connman_session_cleanup() before the
__connman_plugin_cleanup(). We also need to take care not to access
the session_hash in remove_policy() function since that table has
already been destroyed.
---
 src/main.c    | 2 +-
 src/session.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/main.c b/src/main.c
index e21d056..0532abe 100644
--- a/src/main.c
+++ b/src/main.c
@@ -675,11 +675,11 @@ int main(int argc, char *argv[])
        __connman_wpad_cleanup();
        __connman_dhcpv6_cleanup();
        __connman_dhcp_cleanup();
+       __connman_session_cleanup();
        __connman_plugin_cleanup();
        __connman_provider_cleanup();
        __connman_connection_cleanup();
        __connman_timeserver_cleanup();
-       __connman_session_cleanup();
        __connman_detect_cleanup();
        __connman_proxy_cleanup();
        __connman_task_cleanup();
diff --git a/src/session.c b/src/session.c
index 365c71c..ce7aa18 100644
--- a/src/session.c
+++ b/src/session.c
@@ -359,6 +359,9 @@ static void remove_policy(struct connman_session_policy 
*policy)
        gpointer key, value;
        struct connman_session *session;
 
+       if (session_hash == NULL)
+               return;
+
        DBG("policy %p name %s", policy, policy->name);
 
        g_hash_table_iter_init(&iter, session_hash);
-- 
1.8.1.3.566.gaa39828

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to