Skip to content

Commit

Permalink
Merge pull request #19007 from stuartwdouglas/19001
Browse files Browse the repository at this point in the history
Close the RuntimeClassLoader on stop
  • Loading branch information
stuartwdouglas authored Jul 27, 2021
2 parents fe3319a + 05d0462 commit 66e33f0
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 66e33f0

Please sign in to comment.