aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2024-12-23 22:22:05 +0200
committerDecebal Suiu <decebal.suiu@gmail.com>2024-12-23 22:22:05 +0200
commit1e3010c111e99676b6c78588d922ff2f83b5223b (patch)
treec6b8ffbbbfb338758d64e3916d91b0b6994362be
parentf7af060067ff6f9478478b2ae3a2b7410a5e550d (diff)
downloadpf4j-1e3010c111e99676b6c78588d922ff2f83b5223b.tar.gz
pf4j-1e3010c111e99676b6c78588d922ff2f83b5223b.zip
Set class loader to null on unload plugin
-rw-r--r--pf4j/src/main/java/org/pf4j/AbstractPluginManager.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java
index 626dbcb..ac41519 100644
--- a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java
+++ b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java
@@ -337,6 +337,7 @@ public abstract class AbstractPluginManager implements PluginManager {
if (classLoader instanceof Closeable) {
try {
((Closeable) classLoader).close();
+ classLoader = null; // help GC to collect the classloader
} catch (IOException e) {
throw new PluginRuntimeException(e, "Cannot close classloader");
}