From 78d4680b0e6b01608ba15d68f9c6c045ae146be0 Mon Sep 17 00:00:00 2001 From: YoungJun Cho Date: Tue, 10 Oct 2017 15:58:37 +0900 Subject: [PATCH] provider: clean up static global variables Change-Id: I8e5d4ae7a35097e0e52227d62e0ba8ca74c9a6a7 Signed-off-by: YoungJun Cho --- screen_connector_provider/src/screen_connector_provider.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/screen_connector_provider/src/screen_connector_provider.c b/screen_connector_provider/src/screen_connector_provider.c index cc274b9..b6e73d8 100755 --- a/screen_connector_provider/src/screen_connector_provider.c +++ b/screen_connector_provider/src/screen_connector_provider.c @@ -35,8 +35,8 @@ #define LOG_TAG "SC_PROVIDER" -static int __init_count; -static struct tizen_remote_surface_manager *__rsm; +static int __init_count = 0; +static struct tizen_remote_surface_manager *__rsm = NULL; struct screen_connector_provider_s { struct wl_surface *surface; @@ -200,8 +200,10 @@ EXPORT_API int screen_connector_provider_init(void) Ecore_Wl_Global *global; Eina_Inlist *globals; - if (__init_count > 0) + if (__init_count > 0) { + __init_count++; return 0; + } ecore_wl_init(NULL); @@ -235,8 +237,10 @@ EXPORT_API int screen_connector_provider_init(void) EXPORT_API int screen_connector_provider_fini(void) { - if (__init_count > 1) + if (__init_count > 1) { + __init_count--; return 0; + } if (__rsm) tizen_remote_surface_manager_destroy(__rsm); -- 2.7.4