bug fix - call viewmgr_destroy when window exists 39/45339/1 accepted/tizen/tv/20150805.065759 submit/tizen/20150805.043140
authorSoohye Shin <soohye.shin@samsung.com>
Wed, 5 Aug 2015 04:05:13 +0000 (13:05 +0900)
committerSoohye Shin <soohye.shin@samsung.com>
Wed, 5 Aug 2015 04:05:13 +0000 (13:05 +0900)
Change-Id: I6f9830c8c3726811f99824f364ebd89bea3c1699
Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
src/main.c

index 9338fed..fc117fc 100644 (file)
@@ -47,7 +47,6 @@ static Evas_Object *_add_win(const char *name)
 static bool _create(void *user_data)
 {
        struct _appdata *ad;
-       Evas_Object *win;
 
        if (!user_data) {
                _ERR("Invalid argument");
@@ -59,15 +58,15 @@ static bool _create(void *user_data)
        elm_theme_overlay_add(NULL, THEMEFILE);
        elm_config_focus_move_policy_set(ELM_FOCUS_MOVE_POLICY_CLICK);
 
-       win = _add_win(ad->name);
-       if (!win) {
+       ad->win = _add_win(ad->name);
+       if (!ad->win) {
                _ERR("failed to create window");
                return false;
        }
 
-       if (!viewmgr_create(win)) {
+       if (!viewmgr_create(ad->win)) {
                _ERR("failed to create viewmgr");
-               evas_object_del(win);
+               evas_object_del(ad->win);
                return false;
        }
 
@@ -75,8 +74,6 @@ static bool _create(void *user_data)
        viewmgr_add_view(view_recent_get_vclass(), NULL);
        viewmgr_add_view(view_user_get_vclass(), NULL);
 
-       ad->win = win;
-
        return true;
 }
 
@@ -89,11 +86,10 @@ static void _terminate(void *user_data)
 
        ad = user_data;
 
-       viewmgr_remove_view(VIEW_HOME);
-       viewmgr_destroy();
-
-       if (ad->win)
+       if (ad->win) {
+               viewmgr_destroy();
                evas_object_del(ad->win);
+       }
 }
 
 static void _pause(void *user_data)