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.


SVN revision: 40490
This commit is contained in:
Gustavo Sverzut Barbieri 2009-05-02 20:12:41 +00:00
parent 022204e09c
commit 96511aeea4
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}