Fix black screen issue 68/147268/2
authorJaeho Lee <jaeho81.lee@samsung.com>
Sun, 3 Sep 2017 08:38:38 +0000 (17:38 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Sun, 3 Sep 2017 10:42:18 +0000 (19:42 +0900)
- The buffer for watch should be released after the new watch app was added

Change-Id: Ie54e863cab495e672731fa3550eeb98237818a22
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
watch-control/src/control.c

index 26be150..cb0e3fc 100644 (file)
@@ -65,6 +65,7 @@ static int __default_width;
 static int __default_height;
 static screen_connector_toolkit_evas_h __toolkit;
 static screen_connector_toolkit_evas_h __rid_toolkit;
+static screen_connector_toolkit_evas_h __tmp_toolkit;
 
 static Evas_Object *__win;
 static char *__watch_appid;
@@ -394,6 +395,11 @@ static void __screen_connector_toolkit_evas_removed_cb(const char *appid, const
                __rid_toolkit = NULL;
                __is_bound = false;
        }
+
+       if (__tmp_toolkit) {
+               screen_connector_toolkit_evas_remove(__tmp_toolkit);
+               __tmp_toolkit = NULL;
+       }
 }
 
 static void __screen_connector_toolkit_evas_updated_cb(
@@ -916,6 +922,7 @@ static int __launch_signal_handler(const char *endpoint,
        char *viewer = NULL;
        char *pid_str = NULL;
        screen_connector_toolkit_evas_ops ops;
+       bool exist;
 
        bundle_get_str(envelope, AUL_K_WIDGET_VIEWER, &viewer);
        if (viewer == NULL)
@@ -933,8 +940,15 @@ static int __launch_signal_handler(const char *endpoint,
        _D("cur appid(%s), new appid(%s), pid(%s)",
                        __watch_appid, appid, pid_str);
 
-       if (__toolkit)
+       exist = screen_connector_toolkit_is_exist(appid,
+                                       SCREEN_CONNECTOR_SCREEEN_TYPE_WATCH);
+
+       if (exist) {
                screen_connector_toolkit_evas_remove(__toolkit);
+       } else {
+               __tmp_toolkit = __toolkit;
+               _D("Old toolkit %p", __tmp_toolkit);
+       }
 
        ops.added_cb = __screen_connector_toolkit_evas_added_cb;
        ops.removed_cb = __screen_connector_toolkit_evas_removed_cb;