Update vconf cache in notify_cb 05/117105/1
authorJiwoong Im <jiwoong.im@samsung.com>
Thu, 2 Mar 2017 10:15:54 +0000 (19:15 +0900)
committerJiwoong Im <jiwoong.im@samsung.com>
Fri, 3 Mar 2017 00:58:28 +0000 (16:58 -0800)
- cache should be updated in notify_cb to guarantee accurate value.

Change-Id: I47f35e481061462beee602580c449bf56d042063
Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
(cherry picked from commit 49ad9fca0a58811426d4a96424794e577f94bb7d)

vconf-compat/vconf.c

index 5385e9c..28b1d99 100644 (file)
@@ -444,6 +444,11 @@ static void notify_cb(const struct buxton_layer *layer, const char *key,
        node->keyname = strdup(key);
        to_vconf_t(val, node);
 
+       if (g_hash_table_contains(cache_tbl, key)) {
+               g_hash_table_replace(cache_tbl,
+                               strdup(key), buxton_value_duplicate(val));
+       }
+
        g_idle_add_full(G_PRIORITY_HIGH, call_noti_cb, node, NULL);
 }