File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
plugin/src/main/java/org/jenkinsci/plugins/workflow/cps Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -1306,8 +1306,18 @@ synchronized void onProgramEnd(Outcome outcome) {
13061306
13071307 void cleanUpHeap () {
13081308 LOGGER .log (Level .FINE , "cleanUpHeap on {0}" , owner );
1309- shell = null ;
1310- trusted = null ;
1309+ try {
1310+ if (shell != null ) {
1311+ shell .getClassLoader ().close ();
1312+ shell = null ;
1313+ }
1314+ if (trusted != null ) {
1315+ trusted .getClassLoader ().close ();
1316+ trusted = null ;
1317+ }
1318+ } catch (IOException x ) {
1319+ LOGGER .log (Level .WARNING , "failed to close class loaders from " + owner , x );
1320+ }
13111321 if (scriptClass != null ) {
13121322 try {
13131323 cleanUpLoader (scriptClass .getClassLoader (), new HashSet <>(), new HashSet <>());
You can’t perform that action at this time.
0 commit comments