forked from enlightenment/efl
fix ecore-con client double-free case
SVN revision: 82042
This commit is contained in:
parent
5cf84bb84a
commit
90bc1aa27c
|
@ -1,3 +1,7 @@
|
||||||
|
2013-01-03 Carsten Haitzler (The Rasterman)
|
||||||
|
|
||||||
|
* Fixed ecore_con case where freeing server double-frees clients
|
||||||
|
|
||||||
2013-01-03 Jérémy Zurcher
|
2013-01-03 Jérémy Zurcher
|
||||||
|
|
||||||
* Add eio_eet_sync symbols.
|
* Add eio_eet_sync symbols.
|
||||||
|
|
1
NEWS
1
NEWS
|
@ -98,3 +98,4 @@ Fixes:
|
||||||
* eio functions no longer crash when passed NULL and throw errors accordingly
|
* eio functions no longer crash when passed NULL and throw errors accordingly
|
||||||
* Fix eina_xattr_value_ls() and eina_xattr_value_fd_ls()
|
* Fix eina_xattr_value_ls() and eina_xattr_value_fd_ls()
|
||||||
* Fix mask write lines to not choose too small segments
|
* Fix mask write lines to not choose too small segments
|
||||||
|
* Fix ecore_con case where freeing server double-frees clients
|
||||||
|
|
|
@ -2364,16 +2364,24 @@ _ecore_con_event_client_add_free(Ecore_Con_Server *svr,
|
||||||
e = ev;
|
e = ev;
|
||||||
if (e->client)
|
if (e->client)
|
||||||
{
|
{
|
||||||
|
Eina_Bool svrfreed = EINA_FALSE;
|
||||||
|
|
||||||
e->client->event_count = eina_list_remove(e->client->event_count, e);
|
e->client->event_count = eina_list_remove(e->client->event_count, e);
|
||||||
if (e->client->host_server)
|
if (e->client->host_server)
|
||||||
{
|
{
|
||||||
e->client->host_server->event_count = eina_list_remove(e->client->host_server->event_count, ev);
|
e->client->host_server->event_count = eina_list_remove(e->client->host_server->event_count, ev);
|
||||||
if ((!svr->event_count) && (svr->delete_me))
|
if ((!svr->event_count) && (svr->delete_me))
|
||||||
|
{
|
||||||
_ecore_con_server_free(svr);
|
_ecore_con_server_free(svr);
|
||||||
|
svrfreed = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (!svrfreed)
|
||||||
|
{
|
||||||
if ((!e->client->event_count) && (e->client->delete_me))
|
if ((!e->client->event_count) && (e->client->delete_me))
|
||||||
ecore_con_client_del(e->client);
|
ecore_con_client_del(e->client);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ecore_con_event_client_add_free(e);
|
ecore_con_event_client_add_free(e);
|
||||||
_ecore_con_event_count--;
|
_ecore_con_event_count--;
|
||||||
|
@ -2390,16 +2398,24 @@ _ecore_con_event_client_del_free(Ecore_Con_Server *svr,
|
||||||
e = ev;
|
e = ev;
|
||||||
if (e->client)
|
if (e->client)
|
||||||
{
|
{
|
||||||
|
Eina_Bool svrfreed = EINA_FALSE;
|
||||||
|
|
||||||
e->client->event_count = eina_list_remove(e->client->event_count, e);
|
e->client->event_count = eina_list_remove(e->client->event_count, e);
|
||||||
if (e->client->host_server)
|
if (e->client->host_server)
|
||||||
{
|
{
|
||||||
e->client->host_server->event_count = eina_list_remove(e->client->host_server->event_count, ev);
|
e->client->host_server->event_count = eina_list_remove(e->client->host_server->event_count, ev);
|
||||||
if ((!svr->event_count) && (svr->delete_me))
|
if ((!svr->event_count) && (svr->delete_me))
|
||||||
|
{
|
||||||
_ecore_con_server_free(svr);
|
_ecore_con_server_free(svr);
|
||||||
|
svrfreed = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (!svrfreed)
|
||||||
|
{
|
||||||
if (!e->client->event_count)
|
if (!e->client->event_count)
|
||||||
_ecore_con_client_free(e->client);
|
_ecore_con_client_free(e->client);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ecore_con_event_client_del_free(e);
|
ecore_con_event_client_del_free(e);
|
||||||
_ecore_con_event_count--;
|
_ecore_con_event_count--;
|
||||||
if ((!_ecore_con_event_count) && (!_ecore_con_init_count))
|
if ((!_ecore_con_event_count) && (!_ecore_con_init_count))
|
||||||
|
@ -2412,19 +2428,27 @@ _ecore_con_event_client_write_free(Ecore_Con_Server *svr,
|
||||||
{
|
{
|
||||||
if (e->client)
|
if (e->client)
|
||||||
{
|
{
|
||||||
|
Eina_Bool svrfreed = EINA_FALSE;
|
||||||
|
|
||||||
e->client->event_count = eina_list_remove(e->client->event_count, e);
|
e->client->event_count = eina_list_remove(e->client->event_count, e);
|
||||||
if (e->client->host_server)
|
if (e->client->host_server)
|
||||||
{
|
{
|
||||||
e->client->host_server->event_count = eina_list_remove(e->client->host_server->event_count, e);
|
e->client->host_server->event_count = eina_list_remove(e->client->host_server->event_count, e);
|
||||||
if ((!svr->event_count) && (svr->delete_me))
|
if ((!svr->event_count) && (svr->delete_me))
|
||||||
|
{
|
||||||
_ecore_con_server_free(svr);
|
_ecore_con_server_free(svr);
|
||||||
|
svrfreed = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (!svrfreed)
|
||||||
|
{
|
||||||
if (((!e->client->event_count) && (e->client->delete_me)) ||
|
if (((!e->client->event_count) && (e->client->delete_me)) ||
|
||||||
((e->client->host_server &&
|
((e->client->host_server &&
|
||||||
((e->client->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_UDP ||
|
((e->client->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_UDP ||
|
||||||
(e->client->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_MCAST))))
|
(e->client->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_MCAST))))
|
||||||
ecore_con_client_del(e->client);
|
ecore_con_client_del(e->client);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ecore_con_event_client_write_free(e);
|
ecore_con_event_client_write_free(e);
|
||||||
_ecore_con_event_count--;
|
_ecore_con_event_count--;
|
||||||
if ((!_ecore_con_event_count) && (!_ecore_con_init_count))
|
if ((!_ecore_con_event_count) && (!_ecore_con_init_count))
|
||||||
|
@ -2440,19 +2464,27 @@ _ecore_con_event_client_data_free(Ecore_Con_Server *svr,
|
||||||
e = ev;
|
e = ev;
|
||||||
if (e->client)
|
if (e->client)
|
||||||
{
|
{
|
||||||
|
Eina_Bool svrfreed = EINA_FALSE;
|
||||||
|
|
||||||
e->client->event_count = eina_list_remove(e->client->event_count, e);
|
e->client->event_count = eina_list_remove(e->client->event_count, e);
|
||||||
if (e->client->host_server)
|
if (e->client->host_server)
|
||||||
{
|
{
|
||||||
e->client->host_server->event_count = eina_list_remove(e->client->host_server->event_count, ev);
|
e->client->host_server->event_count = eina_list_remove(e->client->host_server->event_count, ev);
|
||||||
}
|
}
|
||||||
if ((!svr->event_count) && (svr->delete_me))
|
if ((!svr->event_count) && (svr->delete_me))
|
||||||
|
{
|
||||||
_ecore_con_server_free(svr);
|
_ecore_con_server_free(svr);
|
||||||
|
svrfreed = EINA_TRUE;
|
||||||
|
}
|
||||||
|
if (!svrfreed)
|
||||||
|
{
|
||||||
if (((!e->client->event_count) && (e->client->delete_me)) ||
|
if (((!e->client->event_count) && (e->client->delete_me)) ||
|
||||||
((e->client->host_server &&
|
((e->client->host_server &&
|
||||||
((e->client->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_UDP ||
|
((e->client->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_UDP ||
|
||||||
(e->client->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_MCAST))))
|
(e->client->host_server->type & ECORE_CON_TYPE) == ECORE_CON_REMOTE_MCAST))))
|
||||||
ecore_con_client_del(e->client);
|
ecore_con_client_del(e->client);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
free(e->data);
|
free(e->data);
|
||||||
ecore_con_event_client_data_free(e);
|
ecore_con_event_client_data_free(e);
|
||||||
_ecore_con_event_count--;
|
_ecore_con_event_count--;
|
||||||
|
@ -2558,16 +2590,24 @@ _ecore_con_event_client_error_free(Ecore_Con_Server *svr, Ecore_Con_Event_Client
|
||||||
{
|
{
|
||||||
if (e->client)
|
if (e->client)
|
||||||
{
|
{
|
||||||
|
Eina_Bool svrfreed = EINA_FALSE;
|
||||||
|
|
||||||
if (eina_list_data_find(svr->clients, e->client))
|
if (eina_list_data_find(svr->clients, e->client))
|
||||||
{
|
{
|
||||||
e->client->event_count = eina_list_remove(e->client->event_count, e);
|
e->client->event_count = eina_list_remove(e->client->event_count, e);
|
||||||
if ((!e->client->event_count) && (e->client->delete_me))
|
if ((!e->client->event_count) && (e->client->delete_me))
|
||||||
|
{
|
||||||
_ecore_con_client_free(e->client);
|
_ecore_con_client_free(e->client);
|
||||||
|
svrfreed = EINA_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
svr->event_count = eina_list_remove(svr->event_count, e);
|
svr->event_count = eina_list_remove(svr->event_count, e);
|
||||||
|
if (!svrfreed)
|
||||||
|
{
|
||||||
if ((!svr->event_count) && (svr->delete_me))
|
if ((!svr->event_count) && (svr->delete_me))
|
||||||
_ecore_con_server_free(svr);
|
_ecore_con_server_free(svr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
free(e->error);
|
free(e->error);
|
||||||
ecore_con_event_client_error_free(e);
|
ecore_con_event_client_error_free(e);
|
||||||
_ecore_con_event_count--;
|
_ecore_con_event_count--;
|
||||||
|
|
Loading…
Reference in New Issue