cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r643871 - in /cocoon/branches/BRANCH_2_1_X/src/blocks: lucene/samples/flow.js portal/samples/coplets/basket/basket.js
Date Wed, 02 Apr 2008 12:14:47 GMT
Author: vgritsenko
Date: Wed Apr  2 05:14:47 2008
New Revision: 643871

URL: http://svn.apache.org/viewvc?rev=643871&view=rev
Log:
disposeObject

Modified:
    cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/samples/flow.js
    cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/basket/basket.js

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/samples/flow.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/samples/flow.js?rev=643871&r1=643870&r2=643871&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/samples/flow.js (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/lucene/samples/flow.js Wed Apr  2 05:14:47 2008
@@ -14,16 +14,22 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 //
 // @version $Id$
 //
+
 function create() {
     var create = cocoon.request.getParameter("create") ? true : false;
     var baseURL = cocoon.request.getParameter("baseURL");
     
     if (baseURL != null && baseURL.length() > 0) {
         var util = cocoon.createObject("org.apache.cocoon.samples.LuceneUtil");
-        util.createIndex(baseURL, create);
+        try {
+            util.createIndex(baseURL, create);
+        } finally {
+            cocoon.disposeObject(util);
+        }
     }
     if (baseURL == null || baseURL.length() < 1) {
         baseURL = "http://" + cocoon.request.getServerName()

Modified: cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/basket/basket.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/basket/basket.js?rev=643871&r1=643870&r2=643871&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/basket/basket.js (original)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/portal/samples/coplets/basket/basket.js Wed Apr
 2 05:14:47 2008
@@ -14,9 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 //
 // @version $Id$
 //
+
 cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
 
 // This function is invoked by every coplet to check if the basket is already full
@@ -25,8 +27,13 @@
     var type = cocoon.parameters["type"];
     var storage = "basket";
 
+    var dom;
     var pu = cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
-    var dom = pu.processToDOM("fetch-quota", { "storage": storage, "type": type});
+    try {
+        dom = pu.processToDOM("fetch-quota", { "storage": storage, "type": type});
+    } finally {
+        cocoon.disposeObject(pu);
+    }
 
     var node = org.apache.excalibur.xml.xpath.XPathUtil.getFirstNodeFromPath(dom,
                         org.apache.excalibur.xml.xpath.XPathUtil.buildPathArray("result/attribute/item"),
false);
@@ -55,8 +62,13 @@
     var type = cocoon.parameters["type"];
     var storage = "basket";
 
+    var dom;
     var pu = cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
-    var dom = pu.processToDOM("fetch-quota", { "storage": storage, "type": type});
+    try {
+        dom = pu.processToDOM("fetch-quota", { "storage": storage, "type": type});
+    } finally {
+        cocoon.disposeObject(pu);
+    }
 
     var node = org.apache.excalibur.xml.xpath.XPathUtil.getFirstNodeFromPath(dom,
                         org.apache.excalibur.xml.xpath.XPathUtil.buildPathArray("result/attribute/item"),
false);
@@ -364,4 +376,4 @@
         }
     }
     cocoon.redirectTo("../../portal", true);
-}
\ No newline at end of file
+}



Mime
View raw message