示例#1
0
 public virtual void Dispose(bool bManaged)
 {
     // if (_vm != null)
     // {
     //     _vm.Destroy();
     //     _vm = null;
     // }
     if (_ctx != IntPtr.Zero)
     {
         DuktapeDLL.duk_destroy_heap(_ctx);
         _ctx = IntPtr.Zero;
     }
 }
示例#2
0
        public void Destroy()
        {
            _instance = null;
            if (_ctx != null)
            {
                var ctx = _ctx.rawValue;
                _ctx.onDestroy();
                _ctx            = null;
                _lastContextPtr = IntPtr.Zero;
                _lastContext    = null;
                _contexts.Clear();
                _objectCache.Clear();
                DuktapeDLL.duk_destroy_heap(ctx);
                // Debug.LogWarning("duk_destroy_heap");
            }

            if (_updateTimer != 0)
            {
                DuktapeRunner.Clear(_updateTimer);
                _updateTimer = 0;
            }
        }