cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=384f30c8ecc95c24582c65fa920d7af99a766894
commit 384f30c8ecc95c24582c65fa920d7af99a766894 Author: Cedric BAIL <[email protected]> Date: Wed May 23 18:03:56 2018 -0700 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. --- src/lib/ecore_con/ecore_con_legacy.c | 10 ++++++++-- 1 file 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) static void _ecore_con_client_free(Ecore_Con_Client *cl) { + Ecore_Con_Server *svr = cl->svr; + cl->delete_me = EINA_TRUE; + cl->svr = NULL; - if (cl->svr) - cl->svr->clients = eina_list_remove(cl->svr->clients, cl); + if (svr) + svr->clients = eina_list_remove(svr->clients, cl); _ecore_con_client_socket_close(cl); @@ -302,6 +305,9 @@ _ecore_con_client_free(Ecore_Con_Client *cl) if (cl->event_count) return; + if (svr && (!svr->event_count) && (svr->delete_me)) + _ecore_con_server_free(svr); + cl->data = NULL; eina_stringshare_replace(&cl->ip, NULL); --
