NTK: Don't keep unneeded clients in session when switching.
This commit is contained in:
parent
8b5f5a76aa
commit
f2bc2b5c9b
|
@ -1242,20 +1242,18 @@ load_session_file ( const char * path )
|
|||
i != client.end();
|
||||
++i )
|
||||
{
|
||||
if ( ! (*i)->is_capable_of( ":switch:" ) )
|
||||
if ( ! (*i)->is_capable_of( ":switch:" ) || client_map.find((*i)->name ) == client_map.end() )
|
||||
{
|
||||
/* client is not capable of switch, or is not wanted in the new session */
|
||||
command_client_to_quit( *i );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( client_map.find((*i)->name ) != client_map.end() )
|
||||
{
|
||||
/* client is switch capable and may be wanted in the new session */
|
||||
if ( client_map[ (*i)->name ]-- <= 0 )
|
||||
/* nope,, we already have as many as we need, stop this one */
|
||||
command_client_to_quit( *i );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue