One quick idea is to wire the link and/or button to a new page called leave.htm.
One this page put the following code:
<html><body>Bye...</body></html>
<% runtime->keep_context = 0. %>
This unfortunately does not help if the user just closes the browser window.
Why not read:
<b>BSP Trouble Shooting: Getting Help</b>
/people/brian.mckellar/blog/2004/06/11/bsp-trouble-shooting-getting-help
There you will find a table of example programs. Maybe it is the missing part of your puzzle.
++bcm
Add a comment