Browse Source

Resolve memory leak when ejecuteJava cleans up AntClassLoader

PR:	20264


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274658 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 22 years ago
parent
commit
1d35a8c41f
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      src/main/org/apache/tools/ant/AntClassLoader.java

+ 4
- 2
src/main/org/apache/tools/ant/AntClassLoader.java View File

@@ -1225,6 +1225,10 @@ public class AntClassLoader extends ClassLoader implements BuildListener {
} }
} }
zipFiles = new Hashtable(); zipFiles = new Hashtable();
if (project != null) {
project.removeBuildListener(this);
}
project = null;
} }


/** /**
@@ -1242,8 +1246,6 @@ public class AntClassLoader extends ClassLoader implements BuildListener {
* @param event the buildFinished event * @param event the buildFinished event
*/ */
public void buildFinished(BuildEvent event) { public void buildFinished(BuildEvent event) {
project.removeBuildListener(this);
project = null;
cleanup(); cleanup();
} }




Loading…
Cancel
Save