Author: peterreilly Date: Thu Aug 23 01:12:13 2007 New Revision: 568876 URL: http://svn.apache.org/viewvc?rev=568876&view=rev Log: place the cleanup code in a finally clause
Modified: ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java?rev=568876&r1=568875&r2=568876&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/UnknownElement.java Thu Aug 23 01:12:13 2007 @@ -283,17 +283,17 @@ throw new BuildException("Could not create task of type: " + elementName, getLocation()); } - - if (realThing instanceof Task) { - ((Task) realThing).execute(); + try { + if (realThing instanceof Task) { + ((Task) realThing).execute(); + } + } finally { + // Finished executing the task, null it to allow + // GC do its job + // If this UE is used again, a new "realthing" will be made + realThing = null; + getWrapper().setProxy(null); } - - // Finished executing the task, null it to allow - // GC do its job - // If this UE is used again, a new "realthing" will be made - realThing = null; - getWrapper().setProxy(null); - } /** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]