Fix sender hash's wrong value destory func 13/71813/3 accepted/tizen/ivi/20160602.022854 accepted/tizen/mobile/20160602.023026 accepted/tizen/tv/20160602.022556 accepted/tizen/wearable/20160602.022741 submit/tizen/20160531.024853 submit/tizen_common/20160530.124515
authorHyunho Kang <hhstark.kang@samsung.com>
Mon, 30 May 2016 04:33:32 +0000 (13:33 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Mon, 30 May 2016 04:33:32 +0000 (13:33 +0900)
Change-Id: I09cfc079309a1d4d309195345b9bab4f883ad9c9
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
src/message-port.c

index 579c9f1..ad80968 100755 (executable)
@@ -921,11 +921,14 @@ static void __on_sender_name_vanished(GDBusConnection *connection,
                const gchar     *name,
                gpointer         user_data)
 {
-       _LOGI("sender name vanished : %s", name);
+       gboolean remove_result = FALSE;
        int *watcher_id = (int *)user_data;
+       remove_result = g_hash_table_remove(__sender_appid_hash, (gpointer)name);
+       if (!remove_result)
+               _LOGE("Fail to remove sender appid from hash : %s", name);
+
        g_bus_unwatch_name(*watcher_id);
        free(watcher_id);
-       g_hash_table_remove(__sender_appid_hash, name);
 }
 
 static bool __check_sender_validation(GVariant *parameters, const char *sender, GDBusConnection *conn)
@@ -1193,7 +1196,7 @@ static bool __initialize(void)
        }
 
        if (__sender_appid_hash == NULL) {
-               __sender_appid_hash = g_hash_table_new_full(g_str_hash, g_str_equal, free, free);
+               __sender_appid_hash = g_hash_table_new_full(g_str_hash, g_str_equal, free, NULL);
                retvm_if(!__sender_appid_hash, false, "fail to create __sender_appid_hash");
        }