Author: peterreilly
Date: Thu Aug 23 01:12:26 2007
New Revision: 568878
URL: http://svn.apache.org/viewvc?rev=568878&view=rev
Log:
sync: place the cleanup code in a finally clause
Modified:
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/UnknownElement.java
Modified:
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/UnknownElement.java
URL:
http://svn.apache.org/viewvc/ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/UnknownElement.java?rev=568878&r1=568877&r2=568878&view=diff
==============================================================================
---
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/UnknownElement.java
(original)
+++
ant/core/branches/ANT_17_BRANCH/src/main/org/apache/tools/ant/UnknownElement.java
Thu Aug 23 01:12:26 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]