summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>2017-05-02 15:35:32 +0300
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>2017-05-11 18:23:48 +0300
commit0e8cda4b0adf0863ef49ba9cfdd6e7d2f9a83799 (patch)
treeb3c5a803821241efa590303a58b09a6b48d8c094
parent7fdb323f49d23e6ceaa6560662b93e64fd37b761 (diff)
downloadswap-manager-0e8cda4b0adf0863ef49ba9cfdd6e7d2f9a83799.tar.gz
swap-manager-0e8cda4b0adf0863ef49ba9cfdd6e7d2f9a83799.tar.bz2
swap-manager-0e8cda4b0adf0863ef49ba9cfdd6e7d2f9a83799.zip
uihv: fix close socket (uihv - manager) after stop
Change-Id: I94e824c1248eae5952b14250b92f54e4d7aaf755 Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
-rw-r--r--ui_viewer/ui_viewer_lib.c19
-rw-r--r--ui_viewer/ui_viewer_screenshot.c1
2 files changed, 15 insertions, 5 deletions
diff --git a/ui_viewer/ui_viewer_lib.c b/ui_viewer/ui_viewer_lib.c
index c895c5b..7ce3e60 100644
--- a/ui_viewer/ui_viewer_lib.c
+++ b/ui_viewer/ui_viewer_lib.c
@@ -68,6 +68,15 @@ static pthread_mutex_t animator_data_mutex;
static struct ecore_animator_data_t animator_data;
static void init_ecore();
+
+static void do_finit(void)
+{
+ if (gTraceInfo.socket.daemonSock != -1)
+ close(gTraceInfo.socket.daemonSock);
+
+ wayland_deinit();
+}
+
__attribute__((constructor)) void init_ui_viewer(void)
{
ui_viewer_clean_log();
@@ -85,11 +94,7 @@ __attribute__((constructor)) void init_ui_viewer(void)
__attribute__((destructor)) void finite_ui_viewer (void)
{
ui_viewer_log("destructor started\n");
-
- if (gTraceInfo.socket.daemonSock != -1)
- close(gTraceInfo.socket.daemonSock);
-
- wayland_deinit();
+ do_finit();
}
static int create_recv_thread(void)
@@ -387,6 +392,10 @@ static void *recvThread(void __unused *data)
PRINTMSG("APP_MSG_STOP");
application_exit();
break;
+ } else if (log.type == APP_MSG_STOP_WITHOUT_KILL) {
+ PRINTMSG("APP_MSG_STOP_WITHOUT_KILL");
+ do_finit();
+ break;
} else if(log.type == APP_MSG_TYPE_AND_INFO) {
PRINTMSG("APP_MSG_TYPE_AND_INFO");
} else if(log.type == APP_MSG_GET_UI_HIERARCHY) {
diff --git a/ui_viewer/ui_viewer_screenshot.c b/ui_viewer/ui_viewer_screenshot.c
index 26b8ae4..3ec3f57 100644
--- a/ui_viewer/ui_viewer_screenshot.c
+++ b/ui_viewer/ui_viewer_screenshot.c
@@ -186,6 +186,7 @@ void wayland_deinit(void)
wl_event_queue_destroy(__edata->wl_queue);
wl_display_disconnect(__edata->wl_display);
free(__edata);
+ __edata = NULL;
}
static struct efl_data *__wayland_init(void)