ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTask.java
Date Wed, 06 Oct 2004 15:38:04 GMT
bodewig     2004/10/06 08:38:04

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/junit
                        JUnitTask.java
  Log:
  plug memory leak in non-forked <junit>
  
  PR: 27420
  
  Revision  Changes    Path
  1.105     +10 -1     ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
  retrieving revision 1.104
  retrieving revision 1.105
  diff -u -r1.104 -r1.105
  --- JUnitTask.java	6 Oct 2004 15:01:55 -0000	1.104
  +++ JUnitTask.java	6 Oct 2004 15:38:04 -0000	1.105
  @@ -654,6 +654,7 @@
               testLists.addAll(executeOrQueue(tests.elements(), forkPerTest));
           }
   
  +        try {
           Iterator iter = testLists.iterator();
           while (iter.hasNext()) {
               List l = (List) iter.next();
  @@ -663,6 +664,11 @@
                   execute(l);
               }            
           }
  +        } finally {
  +            if (classLoader != null && reloading) {
  +                classLoader.cleanup();
  +            }
  +        }
       }
   
       /**
  @@ -1091,6 +1097,9 @@
               }
               if (classLoader != null) {
                   classLoader.resetThreadContextLoader();
  +                if (!reloading) {
  +                    classLoader.cleanup();
  +                }
               }
           }
       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message