--- orig/TagEndGenerator.java	Mon Mar 12 10:18:26 2001
+++ TagEndGenerator.java	Mon Mar 12 10:31:54 2001
@@ -159,7 +159,20 @@
 
 	writer.println("} finally {");
 	writer.pushIndent();
+        String poolName = TagPoolGenerator.getPoolVariableName(tli, ti, attrs);
+        writer.println("if (" + poolName + " != null && " + thVarName + " != null) {");
+        writer.pushIndent();
+        writer.println(poolName + ".releaseHandler(" + thVarName + ");");
+        writer.popIndent();
+        writer.println("} else {");
+        writer.pushIndent();
+        writer.println("if (" + thVarName + " != null) {");
+        writer.pushIndent();
 	writer.println(thVarName+".release();");
+        writer.popIndent();
+        writer.println("}");
+        writer.popIndent();
+        writer.println("}");
 	writer.popIndent();
 	writer.println("}");
 
