jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1240583 - /jmeter/trunk/src/components/org/apache/jmeter/visualizers/BSFListener.java
Date Sat, 04 Feb 2012 18:34:16 GMT
Author: pmouawad
Date: Sat Feb  4 18:34:15 2012
New Revision: 1240583

URL: http://svn.apache.org/viewvc?rev=1240583&view=rev
Log:
Ensure terminate is called

Modified:
    jmeter/trunk/src/components/org/apache/jmeter/visualizers/BSFListener.java

Modified: jmeter/trunk/src/components/org/apache/jmeter/visualizers/BSFListener.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/components/org/apache/jmeter/visualizers/BSFListener.java?rev=1240583&r1=1240582&r2=1240583&view=diff
==============================================================================
--- jmeter/trunk/src/components/org/apache/jmeter/visualizers/BSFListener.java (original)
+++ jmeter/trunk/src/components/org/apache/jmeter/visualizers/BSFListener.java Sat Feb  4
18:34:15 2012
@@ -37,8 +37,9 @@ public class BSFListener extends BSFTest
     private static final long serialVersionUID = 234L;
 
     public void sampleOccurred(SampleEvent event) {
+        BSFManager mgr =null;
         try {
-            BSFManager mgr = getManager();
+            mgr = getManager();
             if (mgr == null) {
                 log.error("Problem creating BSF manager");
                 return;
@@ -47,9 +48,12 @@ public class BSFListener extends BSFTest
             SampleResult result = event.getResult();
             mgr.declareBean("sampleResult", result, SampleResult.class);
             processFileOrScript(mgr);
-            mgr.terminate();
         } catch (BSFException e) {
             log.warn("Problem in BSF script "+e);
+        } finally {
+            if (mgr != null) {
+                mgr.terminate();
+            }
         }
     }
 



Mime
View raw message