Skip to content

Commit

Permalink
When clearing the current thread's Channel, remove the ThreadLocal
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenc committed Jun 10, 2015
1 parent b6f1d07 commit fa8cd95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/hudson/remoting/Channel.java
Expand Up @@ -1425,7 +1425,11 @@ private void updateLastHeard() {

/*package*/ static Channel setCurrent(Channel channel) {
Channel old = CURRENT.get();
CURRENT.set(channel);
if (channel == null) {
CURRENT.remove();
} else {
CURRENT.set(channel);
}
return old;
}

Expand Down

0 comments on commit fa8cd95

Please sign in to comment.