Skip to content

Commit

Permalink
Close the RuntimeClassLoader on stop
Browse files Browse the repository at this point in the history
Fixes #19001
  • Loading branch information
stuartwdouglas committed Jul 26, 2021
1 parent 24829c7 commit 05d0462
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@
import org.eclipse.microprofile.config.ConfigProvider;

import io.quarkus.bootstrap.app.RunningQuarkusApplication;
import io.quarkus.bootstrap.classloading.QuarkusClassLoader;

public class RunningQuarkusApplicationImpl implements RunningQuarkusApplication {

private final Closeable closeTask;
private final ClassLoader classLoader;
private final QuarkusClassLoader classLoader;

private boolean closing;

public RunningQuarkusApplicationImpl(Closeable closeTask, ClassLoader classLoader) {
public RunningQuarkusApplicationImpl(Closeable closeTask, QuarkusClassLoader classLoader) {
this.closeTask = closeTask;
this.classLoader = classLoader;
}
Expand All @@ -30,7 +31,11 @@ public ClassLoader getClassLoader() {
public void close() throws Exception {
if (!closing) {
closing = true;
closeTask.close();
try {
closeTask.close();
} finally {
classLoader.close();
}
}
}

Expand Down

0 comments on commit 05d0462

Please sign in to comment.