Example #1
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_default(ctx);
                // Debug.LogWarning("duk_destroy_heap");
            }

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