eldbus: send exit/quit event upon disconnecting the session bus

if an application is connected to the session bus, being disconnected
should indicate that the session has been terminated and all applications
in that session should also be terminated

this ensures that no zombie processes will remain after the session bus dies
This commit is contained in:
Mike Blumenkrantz 2016-05-06 15:32:58 -04:00
parent 236c13df34
commit 8a5abfbfc3
1 changed files with 9 additions and 0 deletions

View File

@ -979,8 +979,17 @@ static void
_disconnected(void *data, const Eldbus_Message *msg EINA_UNUSED)
{
Eldbus_Connection *conn = data;
Ecore_Event_Signal_Exit *ev;
_eldbus_connection_event_callback_call(
conn, ELDBUS_CONNECTION_EVENT_DISCONNECTED, NULL);
if (conn->type != ELDBUS_CONNECTION_TYPE_SESSION) return;
ev = calloc(1, sizeof(Ecore_Event_Signal_Exit));
if (!ev) return;
ev->quit = EINA_TRUE;
ecore_event_add(ECORE_EVENT_SIGNAL_EXIT, ev, NULL, NULL);
}
/* Param address is only used for ELDBUS_CONNECTION_TYPE_ADDRESS type */