Modified flushing memory logic
[platform/core/appfw/app-core.git] / src / efl_base / appcore_efl_base.c
index d193f38..b8880ea 100644 (file)
@@ -193,6 +193,13 @@ static void __efl_app_exit(void *data)
        elm_exit();
 }
 
+static void __efl_app_trim_memory(void *data)
+{
+       _DBG("Trim memory");
+       elm_cache_all_flush();
+       appcore_base_on_trim_memory();
+}
+
 EXPORT_API int appcore_efl_base_init(appcore_efl_base_ops ops, int argc,
                char **argv, void *data, unsigned int hint)
 {
@@ -215,6 +222,7 @@ EXPORT_API appcore_efl_base_ops appcore_efl_base_get_default_ops(void)
        ops.ui_base.base.finish = __efl_app_finish;
        ops.ui_base.base.run = __efl_app_run;
        ops.ui_base.base.exit = __efl_app_exit;
+       ops.ui_base.base.trim_memory = __efl_app_trim_memory;
 
        return ops;
 }
@@ -249,6 +257,11 @@ EXPORT_API int appcore_efl_base_on_control(bundle *b)
        return appcore_ui_base_on_control(b);
 }
 
+EXPORT_API int appcore_efl_base_on_trim_memory(void)
+{
+       return appcore_ui_base_on_trim_memory();
+}
+
 EXPORT_API void appcore_efl_base_window_on_show(int type, void *event)
 {
        appcore_ui_base_window_on_show(type, event);