Update finalize function
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 13 Jun 2013 01:08:58 +0000 (10:08 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 13 Jun 2013 01:23:56 +0000 (10:23 +0900)
[model] Tizen
[binary_type] AP
[customer] Tizen Developer
[issue#] N/A
[problem] Even though the module unloaded, allocated data is not released correctly.
[cause] Update finalize function.
[solution] Destroy all created handles.
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: I31a2be8d6cdcece725730f4c978025bff2ade3d4

include/debug.h
packaging/liblivebox-edje.spec
src/script_port.c

index 5904b4c..7583ba9 100644 (file)
  * limitations under the License.
  */
 
-#define DbgPrint(format, arg...)       LOGD("[\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg)
-#define ErrPrint(format, arg...)       LOGE("[\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg)
+#if !defined(SECURE_LOGD)
+#define SECURE_LOGD LOGD
+#endif
+
+#if !defined(SECURE_LOGE)
+#define SECURE_LOGE LOGE
+#endif
+
+#if !defined(SECURE_LOGW)
+#define SECURE_LOGW LOGW
+#endif
+
+#define DbgPrint(format, arg...)       SECURE_LOGD("[\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg)
+#define ErrPrint(format, arg...)       SECURE_LOGE("[\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg)
 /* End of a file */
index 8f3d142..7480574 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-edje
 Summary: EDJE Script loader for the data provider master
-Version: 0.5.7
+Version: 0.5.8
 Release: 1
 Group: HomeTF/Livebox
 License: Flora License
index 38451e5..bd8d71b 100644 (file)
@@ -85,9 +85,13 @@ struct obj_info {
 static struct {
        char *font_name;
        int font_size;
+
+       Eina_List *handle_list;
 } s_info = {
        .font_name = NULL,
        .font_size = -100,
+
+       .handle_list = NULL,
 };
 
 static inline double scale_get(void)
@@ -1358,6 +1362,8 @@ PUBLIC void *script_create(const char *file, const char *group)
                return NULL;
        }
 
+       s_info.handle_list = eina_list_append(s_info.handle_list, handle);
+
        return handle;
 }
 
@@ -1368,6 +1374,13 @@ PUBLIC int script_destroy(void *_handle)
 
        handle = _handle;
 
+       if (!eina_list_data_find(s_info.handle_list, handle)) {
+               DbgPrint("Not found (already deleted?)\n");
+               return LB_STATUS_ERROR_NOT_EXIST;
+       }
+
+       s_info.handle_list = eina_list_remove(s_info.handle_list, handle);
+
        edje = eina_list_nth(handle->obj_list, 0);
        if (edje)
                evas_object_del(edje);
@@ -1603,8 +1616,16 @@ PUBLIC int script_init(void)
 PUBLIC int script_fini(void)
 {
        int ret;
+       Eina_List *l;
+       Eina_List *n;
+       struct info *handle;
+
+       EINA_LIST_FOREACH_SAFE(s_info.handle_list, l, n, handle) {
+               script_destroy(handle);
+       }
+
        ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_FONT_SIZE);
-       ret = system_settings_unset_changed_cb(SYSTEM_SETTINGS_KEY_FONT_TYPE);
+       ret = vconf_ignore_key_changed("db/setting/accessibility/font_name", font_changed_cb);
        ret = vconf_ignore_key_changed(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, access_cb);
        elm_shutdown();
        return LB_STATUS_SUCCESS;