public static void Exit()
{
object helper = VMBridge.instance.GetThreadContextHelper();
Rhino.Context cx = VMBridge.instance.GetContext(helper);
if (cx == null)
{
throw new InvalidOperationException("Calling Context.exit without previous Context.enter");
}
if (cx.enterCount < 1)
{
Kit.CodeBug();
}
if (--cx.enterCount == 0)
{
VMBridge.instance.SetContext(helper, null);
cx.factory.OnContextReleased(cx);
}
}