Fix a bug about app property 19/265619/1
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 25 Oct 2021 09:52:30 +0000 (18:52 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 25 Oct 2021 09:52:30 +0000 (18:52 +0900)
The app property handle has to be added when the user login event occurs.
Currently, the app property is not added if the database is deleted or corrupted.

Change-Id: Ifa088495832d7248876253cc73b72a2862b70f43
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/amd_app_property.c

index 9772cde..9579134 100644 (file)
@@ -587,15 +587,14 @@ int _app_property_load(uid_t uid)
        if (prop == NULL)
                return -1;
 
+       g_hash_table_insert(user_prop_table, GUINT_TO_POINTER(uid), prop);
+
        ret = __load_app_property(prop);
        if (ret < 0) {
                _E("Failed to load properties - ret(%d)", ret);
-               __destroy_app_property(prop);
                return -1;
        }
 
-       g_hash_table_insert(user_prop_table, GUINT_TO_POINTER(uid), prop);
-
        return 0;
 }