예제 #1
0
        public void Dispose()
        {
            System.Diagnostics.Debug.WriteLine("Disposing " + GetHashCode().ToString());

            try
            {
                Native.ThrowIfError(Native.JsSetCurrentContext(JavaScriptContext.Invalid));
            }
            catch (Exception e)
            {
                throw new Exception("JsSetCurrentContext faild" + GetErrorMessage(), e);
            }
            try
            {
                Native.ThrowIfError(Native.JsDisableRuntimeExecution(runtime));
            }
            catch (Exception e)
            {
                throw new Exception("JsDisableRuntimeExecution faild" + GetErrorMessage(), e);
            }
            try
            {
                runtime.Dispose();
            }
            catch (Exception e)
            {
                throw new Exception("JsDispose faild" + GetErrorMessage(), e);
            }
        }