From f2bc2b5c9bd6df92127927bb7d4a84708ded7d4d Mon Sep 17 00:00:00 2001 From: Jonathan Moore Liles Date: Sun, 5 May 2013 10:30:08 -0700 Subject: [PATCH] NTK: Don't keep unneeded clients in session when switching. --- session-manager/src/nsmd.C | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/session-manager/src/nsmd.C b/session-manager/src/nsmd.C index 1d4347c..d60ae9c 100644 --- a/session-manager/src/nsmd.C +++ b/session-manager/src/nsmd.C @@ -1242,19 +1242,17 @@ 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 ); - } + /* 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 ); } }