From 207d25b3ab7f640855f2c8c1e21380e0995118f5 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 29 Aug 2009 23:26:15 -0700 Subject: [PATCH] Fix profile cleanup race condition --- src/profile.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/profile.c b/src/profile.c index 0b2a411..71a3067 100644 --- a/src/profile.c +++ b/src/profile.c @@ -706,15 +706,13 @@ void __connman_profile_cleanup(void) { DBG(""); - if (profiles != NULL) { - g_hash_table_destroy(profiles); - profiles = NULL; - } - - connman_storage_unregister(&profile_storage); - if (connection == NULL) return; + g_hash_table_destroy(profiles); + profiles = NULL; + + connman_storage_unregister(&profile_storage); + dbus_connection_unref(connection); } -- 2.7.4