summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-05-23 18:03:56 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-24 16:02:21 -0700
commit384f30c8ecc95c24582c65fa920d7af99a766894 (patch)
tree26090ca7a1212f8d10b203fd5fed8a8fa17865c7 /src/lib/ecore_con
parent256b2103c6d8f0205b6cf4c24567e40dbb286328 (diff)
ecore_con: disconnect from the server as soon as it request it.
Ecore_Event can still be in flight while the client get freed by the server. We are protected agaist that and keep the client partially alive until the event are processed, but we need to disconnect from the server as soon as possible as we might outlive the server.
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/ecore_con_legacy.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/ecore_con/ecore_con_legacy.c b/src/lib/ecore_con/ecore_con_legacy.c
index e4e631c922..67e491ffbb 100644
--- a/src/lib/ecore_con/ecore_con_legacy.c
+++ b/src/lib/ecore_con/ecore_con_legacy.c
@@ -270,10 +270,13 @@ _ecore_con_client_socket_close(Ecore_Con_Client *cl)
270static void 270static void
271_ecore_con_client_free(Ecore_Con_Client *cl) 271_ecore_con_client_free(Ecore_Con_Client *cl)
272{ 272{
273 Ecore_Con_Server *svr = cl->svr;
274
273 cl->delete_me = EINA_TRUE; 275 cl->delete_me = EINA_TRUE;
276 cl->svr = NULL;
274 277
275 if (cl->svr) 278 if (svr)
276 cl->svr->clients = eina_list_remove(cl->svr->clients, cl); 279 svr->clients = eina_list_remove(svr->clients, cl);
277 280
278 _ecore_con_client_socket_close(cl); 281 _ecore_con_client_socket_close(cl);
279 282
@@ -302,6 +305,9 @@ _ecore_con_client_free(Ecore_Con_Client *cl)
302 305
303 if (cl->event_count) return; 306 if (cl->event_count) return;
304 307
308 if (svr && (!svr->event_count) && (svr->delete_me))
309 _ecore_con_server_free(svr);
310
305 cl->data = NULL; 311 cl->data = NULL;
306 eina_stringshare_replace(&cl->ip, NULL); 312 eina_stringshare_replace(&cl->ip, NULL);
307 313