mirror of
https://github.com/jetty/jetty.project.git
synced 2025-03-03 20:39:18 +00:00
423255 MBeans of SessionIdManager can leak memory on redeploy
This commit is contained in:
parent
cf3acd376f
commit
dd0f50fc72
@ -227,11 +227,25 @@ public abstract class AbstractSessionManager extends AbstractLifeCycle implement
|
||||
_sessionIdManager=server.getSessionIdManager();
|
||||
if (_sessionIdManager==null)
|
||||
{
|
||||
_sessionIdManager=new HashSessionIdManager();
|
||||
server.setSessionIdManager(_sessionIdManager);
|
||||
//create a default SessionIdManager and set it as the shared
|
||||
//SessionIdManager for the Server, being careful NOT to use
|
||||
//the webapp context's classloader, otherwise if the context
|
||||
//is stopped, the classloader is leaked.
|
||||
ClassLoader serverLoader = server.getClass().getClassLoader();
|
||||
try
|
||||
{
|
||||
Thread.currentThread().setContextClassLoader(serverLoader);
|
||||
_sessionIdManager=new HashSessionIdManager();
|
||||
server.setSessionIdManager(_sessionIdManager);
|
||||
}
|
||||
finally
|
||||
{
|
||||
Thread.currentThread().setContextClassLoader(_loader);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!_sessionIdManager.isStarted())
|
||||
_sessionIdManager.start();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user