#include "msg-ui-composer-data.h"
#include "msg-ui-composer-util.h"
+int msg_ui_composer_get_ref_count(void);
+void msg_ui_composer_increase_ref_count(void);
+void msg_ui_composer_decrease_ref_count(void);
+
COMPOSER_RETURN_TYPE_E msg_ui_composer_init(MSG_COMPOSER_VIEW_DATA_S *cd);
COMPOSER_RETURN_TYPE_E msg_ui_composer_create(MSG_COMPOSER_VIEW_DATA_S *cd);
COMPOSER_RETURN_TYPE_E msg_ui_composer_start(MSG_COMPOSER_VIEW_DATA_S *cd, service_h svc_handle);
#define UG_MODULE_API __attribute__ ((visibility("default")))
#endif
+int ref_count;
+
+int msg_ui_composer_get_ref_count(void)
+{
+ D_MSG("ref_count = %d", ref_count);
+ return ref_count;
+}
+
+void msg_ui_composer_increase_ref_count(void)
+{
+ ++ref_count;
+ D_MSG("ref_count = %d", ref_count);
+}
+
+void msg_ui_composer_decrease_ref_count(void)
+{
+ --ref_count;
+ D_MSG("ref_count = %d", ref_count);
+
+ if (ref_count < 0)
+ ref_count = 0;
+}
+
static void __base_layout_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
D_ENTER;
return NULL;
}
+ if (cd->base)
+ msg_ui_composer_increase_ref_count();
+
return cd->base;
}
COMPOSER_RETURN_TYPE_E msg_ui_composer_destroy(MSG_COMPOSER_VIEW_DATA_S *cd)
{
D_ENTER;
-
COMPOSER_RETURN_TYPE_E ret = COMPOSER_RETURN_SUCCESS;
+
+ msg_ui_composer_decrease_ref_count();
+
if (!cd)
return COMPOSER_RETURN_FAIL;
}
/* rollback indicator mode to previous mode */
- elm_win_indicator_mode_set(cd->main_window, cd->indicator_mode);
+ if (msg_ui_composer_get_ref_count() <= 0)
+ elm_win_indicator_mode_set(cd->main_window, cd->indicator_mode);
D_PRINT("===== Composer UG Destroy End =====");