#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()
{
if (!registry || !globals) {
LOGE("could not get registry(%p) or global list(%p)", registry,
globals);
+ ecore_wl_shutdown();
return -1;
}
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;
}