From 38495bec11585e162bbe617424ff00d99d0325ab Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 13 Sep 2002 08:54:26 +0000 Subject: [PATCH] Release references to the child project when has been done. PR: 12499 Submitted by: git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273321 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Ant.java | 6 ++++++ src/main/org/apache/tools/ant/taskdefs/Property.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/main/org/apache/tools/ant/taskdefs/Ant.java b/src/main/org/apache/tools/ant/taskdefs/Ant.java index 402737901..f9e98e6e5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Ant.java +++ b/src/main/org/apache/tools/ant/taskdefs/Ant.java @@ -377,6 +377,12 @@ public class Ant extends Task { } finally { // help the gc newProject = null; + Enumeration enum = properties.elements(); + while (enum.hasMoreElements()) { + Property p = (Property) enum.nextElement(); + p.setProject(null); + } + if (output != null && out != null) { try { out.close(); diff --git a/src/main/org/apache/tools/ant/taskdefs/Property.java b/src/main/org/apache/tools/ant/taskdefs/Property.java index dfcc51b55..aadb591d9 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Property.java +++ b/src/main/org/apache/tools/ant/taskdefs/Property.java @@ -320,6 +320,10 @@ public class Property extends Task { * here is where it is loaded */ public void execute() throws BuildException { + if (getProject() == null) { + throw new IllegalStateException("project has not been set"); + } + if (name != null) { if (value == null && ref == null) { throw new BuildException("You must specify value, location or "