summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoungJun Cho <yj44.cho@samsung.com>2017-10-10 17:56:29 +0900
committerHyunho Kang <hhstark.kang@samsung.com>2017-10-19 09:35:35 +0900
commit661d38e940aa54480b6e7f2241fb69e24f14c245 (patch)
treed3b158e4c3aca2392ba87faa29a08261950d6067
parent95775786ed68c38c46a2105d1c13035a15204a87 (diff)
downloadscreen-connector-661d38e940aa54480b6e7f2241fb69e24f14c245.tar.gz
screen-connector-661d38e940aa54480b6e7f2241fb69e24f14c245.tar.bz2
screen-connector-661d38e940aa54480b6e7f2241fb69e24f14c245.zip
watcher: trs: clean up screen_connector_trs_init()
Change-Id: I3673fe5ab1f6044f01a2474356e2f067f1a0d738 Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
-rw-r--r--screen_connector_watcher/src/screen_connector_trs.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/screen_connector_watcher/src/screen_connector_trs.c b/screen_connector_watcher/src/screen_connector_trs.c
index 548fcc1..bbe7ef4 100644
--- a/screen_connector_watcher/src/screen_connector_trs.c
+++ b/screen_connector_watcher/src/screen_connector_trs.c
@@ -33,9 +33,9 @@
#define LOG_TAG "SC_WATCHER"
static struct tizen_remote_surface_manager *__rsm = NULL;
-static struct wayland_tbm_client *__tbm_client;
+static struct wayland_tbm_client *__tbm_client = NULL;
static struct wl_tbm *__tbm = NULL;
-static bool __is_init;
+static bool __is_init = false;
struct wl_tbm *screen_connector_get_tbm()
{
@@ -65,6 +65,7 @@ int screen_connector_trs_init(void)
if (!registry || !globals) {
LOGE("could not get registry(%p) or global list(%p)", registry,
globals);
+ ecore_wl_shutdown();
return -1;
}
@@ -78,18 +79,24 @@ int screen_connector_trs_init(void)
if (!__rsm) {
LOGE("could not get remote surface manager");
+ ecore_wl_shutdown();
return -1;
}
__tbm_client = (struct wayland_tbm_client *)wayland_tbm_client_init(ecore_wl_display_get());
if (!__tbm_client) {
LOGE("could not get tbm client");
+ tizen_remote_surface_manager_destroy(__rsm);
+ ecore_wl_shutdown();
return -1;
}
__tbm = (struct wl_tbm *)wayland_tbm_client_get_wl_tbm(__tbm_client);
if (!__tbm) {
LOGE("could not get tbm");
+ wayland_tbm_client_deinit(__tbm_client);
+ tizen_remote_surface_manager_destroy(__rsm);
+ ecore_wl_shutdown();
return -1;
}