Browse Source

Set context classloader to null in WorkQueue

If threads created by the executor have a reference to the context
classloader this may cause a leak.

See: https://wiki.apache.org/tomcat/MemoryLeakProtection#cclThreadSpawnedByWebApp
Bug: 517107
Change-Id: If79c1ebd3f9cf733fd88a5fce38fd46ff0d08d10
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
stable-4.10
Matthias Sohn 7 years ago
parent
commit
95f868f246
  1. 1
      org.eclipse.jgit/src/org/eclipse/jgit/lib/internal/WorkQueue.java

1
org.eclipse.jgit/src/org/eclipse/jgit/lib/internal/WorkQueue.java

@ -71,6 +71,7 @@ public class WorkQueue {
public Thread newThread(Runnable taskBody) { public Thread newThread(Runnable taskBody) {
Thread thr = baseFactory.newThread(taskBody); Thread thr = baseFactory.newThread(taskBody);
thr.setName("JGit-WorkQueue"); //$NON-NLS-1$ thr.setName("JGit-WorkQueue"); //$NON-NLS-1$
thr.setContextClassLoader(null);
thr.setDaemon(true); thr.setDaemon(true);
return thr; return thr;
} }

Loading…
Cancel
Save