Fix N_SE-25254, splitview composer indicator issue, ref_count is applied in composer
authorSoonmin Jung <sm0415.jung@samsung.com>
Thu, 14 Feb 2013 07:44:24 +0000 (16:44 +0900)
committerSoonmin Jung <sm0415.jung@samsung.com>
Thu, 14 Feb 2013 07:44:24 +0000 (16:44 +0900)
Change-Id: I6e90b0576711ebc2fb5bfbc8128ace88cdcea50f

composer/include/msg-ui-composer-main.h
composer/src/gadget/msg-ui-composer-gadget.c
composer/src/ui-composer/msg-ui-composer-main.c

index 73f712b..9f0ae0a 100755 (executable)
 #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);
index e86e592..d99cde7 100755 (executable)
 #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;
@@ -173,6 +196,9 @@ static void *__msg_ui_composer_on_create(ui_gadget_h ug, enum ug_mode mode, serv
                return NULL;
        }
 
+       if (cd->base)
+               msg_ui_composer_increase_ref_count();
+
        return cd->base;
 }
 
index 3c98b6a..0fc0a16 100755 (executable)
@@ -1195,8 +1195,10 @@ static void __msg_composer_auto_save_and_delete_msg(MSG_COMPOSER_VIEW_DATA_S *cd
 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;
 
@@ -1280,7 +1282,8 @@ COMPOSER_RETURN_TYPE_E msg_ui_composer_destroy(MSG_COMPOSER_VIEW_DATA_S *cd)
        }
 
        /* 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 =====");