Пример #1
0
        public Chip2D()
        {
            SwigObject = Engine.ObjectSystemFactory.CreateChip2D();

            var p = SwigObject.GetPtr();

            if (GC.Shapes.GetObject(p) != null)
            {
                Particular.Helper.ThrowException("");
            }
            GC.Chip2Ds.AddObject(p, this);
        }
Пример #2
0
        public Chip2D()
        {
            CoreInstance = Engine.ObjectSystemFactory.CreateChip2D();

            var p = CoreInstance.GetPtr();

            if (GC.Chip2Ds.Contains(p))
            {
                Particular.Helper.ThrowException("");
            }

            GC.Chip2Ds.AddObject(p, this);
        }
Пример #3
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            var core = CoreInstance;

            if (core != null)
            {
                GC.Collector.AddObject(core);
                CoreInstance = null;
            }

            disposed = true;
        }
Пример #4
0
 public void Destroy()
 {
     lock (this)
     {
         if (SwigObject == null) return;
         GC.Collector.AddObject(SwigObject);
         SwigObject = null;
     }
     Particular.GC.SuppressFinalize(this);
 }