From: barbieri Date: Sat, 2 May 2009 20:12:41 +0000 (+0000) Subject: proper cleanup of ecoren_con_server after ecore_events. X-Git-Tag: build/2012-07-04.173327~2573 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e71f4ed83cfb877c61f1d04964688fc59bbbaa6a;p=profile%2Fivi%2Fecore.git proper cleanup of ecoren_con_server after ecore_events. ecore_events are asynchronous and can be dispatched after the server is deleted (ecore_con_server_del()). In this case, server will flag "delete_me" and avoid doing double-free. When the event is dispatched and the server is deleted, we still need to free resources and so we need to call _ecore_con_server_free(). But we cannot do that by means of ecore_con_server_del() since it will check "delete_me" flag and will return. This patch calls _ecore_con_server_free() directly when events are dispatched and server is deleted. It fixes problems with forecasts/weather modules exhausting file descriptors, a long standing issue that bring problems with pam/desklock authentication. Thanks to manio to point out #305 and testing. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@40490 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c index 1be24d0..04a41df 100644 --- a/src/lib/ecore_con/ecore_con.c +++ b/src/lib/ecore_con/ecore_con.c @@ -1728,7 +1728,7 @@ _ecore_con_event_server_add_free(void *data __UNUSED__, void *ev) e = ev; e->server->event_count--; if ((e->server->event_count == 0) && (e->server->delete_me)) - ecore_con_server_del(e->server); + _ecore_con_server_free(e->server); free(e); } @@ -1740,7 +1740,7 @@ _ecore_con_event_server_del_free(void *data __UNUSED__, void *ev) e = ev; e->server->event_count--; if ((e->server->event_count == 0) && (e->server->delete_me)) - ecore_con_server_del(e->server); + _ecore_con_server_free(e->server); free(e); } @@ -1753,6 +1753,6 @@ _ecore_con_event_server_data_free(void *data __UNUSED__, void *ev) e->server->event_count--; if (e->data) free(e->data); if ((e->server->event_count == 0) && (e->server->delete_me)) - ecore_con_server_del(e->server); + _ecore_con_server_free(e->server); free(e); }