NSM: Don't forget to inform GUI of the removal of stopped clients when closing a session.

pull/3/head
Jonathan Moore Liles 2012-02-26 18:09:04 -08:00
parent cdcc61d75b
commit 1cdc62416d
1 changed files with 13 additions and 8 deletions

View File

@ -246,22 +246,23 @@ handle_client_process_death ( int pid )
c->pending_command = COMMAND_NONE;
if ( gui_is_active )
{
if ( ! c->dead_because_we_said )
osc_server->send( gui_addr, "/nsm/gui/client/status", c->client_id, c->status = "stopped" );
else
osc_server->send( gui_addr, "/nsm/gui/client/status", c->client_id, c->status = "removed" );
}
c->active = false;
c->pid = 0;
if ( c->dead_because_we_said )
{
if ( gui_is_active )
osc_server->send( gui_addr, "/nsm/gui/client/status", c->client_id, c->status = "removed" );
client.remove( c );
delete c;
}
else
{
if ( gui_is_active )
osc_server->send( gui_addr, "/nsm/gui/client/status", c->client_id, c->status = "stopped" );
}
}
}
@ -583,7 +584,11 @@ purge_inactive_clients ( )
{
if ( ! (*i)->active )
{
if ( gui_is_active )
osc_server->send( gui_addr, "/nsm/gui/client/status", (*i)->client_id, (*i)->status = "removed" );
delete *i;
i = client.erase( i );
}
}