Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2009-05-11 13:08:14 +0000
committerThomas Watson2009-05-11 13:08:14 +0000
commit29afaa98bc553564c553ab42b221a124bd9a26b4 (patch)
tree9d7dad523dc9d4c04b9f100f710892abc93d21dd
parent257dcc923649fbd8e06d29df00b120e50edde622 (diff)
downloadrt.equinox.framework-29afaa98bc553564c553ab42b221a124bd9a26b4.tar.gz
rt.equinox.framework-29afaa98bc553564c553ab42b221a124bd9a26b4.tar.xz
rt.equinox.framework-29afaa98bc553564c553ab42b221a124bd9a26b4.zip
Bug 275166 ClassLoader leak caused by EventManager's EventThread creationv20090511
-rw-r--r--bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/MRUBundleFileList.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/MRUBundleFileList.java b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/MRUBundleFileList.java
index b36c17da2..df8098d88 100644
--- a/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/MRUBundleFileList.java
+++ b/bundles/org.eclipse.osgi/defaultAdaptor/src/org/eclipse/osgi/baseadaptor/bundlefile/MRUBundleFileList.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -50,6 +50,8 @@ public class MRUBundleFileList implements EventDispatcher {
private int numOpen = 0;
// the current use stamp
private long curUseStamp = 0;
+ // used to work around bug 275166
+ private boolean firstDispatch = true;
public MRUBundleFileList() {
this(PROP_FILE_LIMIT_VALUE);
@@ -114,7 +116,7 @@ public class MRUBundleFileList implements EventDispatcher {
numOpen++;
}
// must not close the toRemove bundle file while holding the lock of another bundle file (bug 161976)
- // This queue the bundle file for close asynchronously.
+ // This queues the bundle file for close asynchronously.
closeBundleFile(toRemove);
}
@@ -171,6 +173,11 @@ public class MRUBundleFileList implements EventDispatcher {
}
public final void dispatchEvent(Object eventListener, Object listenerObject, int eventAction, Object eventObject) {
+ if (firstDispatch) {
+ // used to work around bug 275166; we don't want to leak the TCCL in this thread.
+ Thread.currentThread().setContextClassLoader(null);
+ firstDispatch = false;
+ }
try {
closingBundleFile.set(eventObject);
((BundleFile) eventObject).close();

Back to the top