diff --git a/src/helma/framework/core/Application.java b/src/helma/framework/core/Application.java index 18b995c9..6aec41b4 100644 --- a/src/helma/framework/core/Application.java +++ b/src/helma/framework/core/Application.java @@ -482,8 +482,8 @@ public final class Application implements Runnable { if (allThreads != null) { for (Enumeration e = allThreads.elements(); e.hasMoreElements();) { RequestEvaluator ev = (RequestEvaluator) e.nextElement(); - ev.stopTransactor(); + ev.shutdown(); } } diff --git a/src/helma/framework/core/RequestEvaluator.java b/src/helma/framework/core/RequestEvaluator.java index d7d66b42..b2aee3ef 100644 --- a/src/helma/framework/core/RequestEvaluator.java +++ b/src/helma/framework/core/RequestEvaluator.java @@ -124,6 +124,12 @@ public final class RequestEvaluator implements Runnable { } } + protected synchronized void shutdown() { + if (scriptingEngine != null) { + scriptingEngine.shutdown(); + } + } + /** * */ diff --git a/src/helma/scripting/ScriptingEngine.java b/src/helma/scripting/ScriptingEngine.java index 9e0fe0d7..39933826 100644 --- a/src/helma/scripting/ScriptingEngine.java +++ b/src/helma/scripting/ScriptingEngine.java @@ -60,6 +60,11 @@ public interface ScriptingEngine { */ public void init(Application app, RequestEvaluator reval); + /** + * Shut down the Scripting engine. + */ + public void shutdown(); + /** * This method is called when an execution context for a request * evaluation is entered to let the Engine know it should update diff --git a/src/helma/scripting/rhino/RhinoCore.java b/src/helma/scripting/rhino/RhinoCore.java index 05c6ed79..073140aa 100644 --- a/src/helma/scripting/rhino/RhinoCore.java +++ b/src/helma/scripting/rhino/RhinoCore.java @@ -191,6 +191,13 @@ public final class RhinoCore implements ScopeProvider { return isInitialized; } + public void shutdown() { + if (debugger != null) { + debugger.dispose(); + debugger = null; + } + } + void initDebugger(Context context) { context.setGeneratingDebug(true); try { diff --git a/src/helma/scripting/rhino/RhinoEngine.java b/src/helma/scripting/rhino/RhinoEngine.java index a9282f4a..7d90d990 100644 --- a/src/helma/scripting/rhino/RhinoEngine.java +++ b/src/helma/scripting/rhino/RhinoEngine.java @@ -117,6 +117,13 @@ public class RhinoEngine implements ScriptingEngine { } } + /** + * Shut down the scripting engine. + */ + public void shutdown() { + core.shutdown(); + } + /** * Return the RhinoEngine associated with the current thread, or null. * @return the RhinoEngine assocated with the current thread diff --git a/src/helma/scripting/rhino/debug/HelmaDebugger.java b/src/helma/scripting/rhino/debug/HelmaDebugger.java index 80325de3..acbdf9eb 100644 --- a/src/helma/scripting/rhino/debug/HelmaDebugger.java +++ b/src/helma/scripting/rhino/debug/HelmaDebugger.java @@ -113,6 +113,12 @@ public class HelmaDebugger extends Dim implements TreeSelectionListener { gui.setVisible(visible); } + public void dispose() { + super.dispose(); + gui.setVisible(false); + gui.dispose(); + } + class DebuggerTreeNode extends DefaultMutableTreeNode { public DebuggerTreeNode(Object obj) {