Beispiel #1
0
 public void Destroy()
 {
     lock (this)
     {
         if (SwigObject == null) return;
         GC.Collector.AddObject(SwigObject);
         SwigObject = null;
     }
     Particular.GC.SuppressFinalize(this);
 }
Beispiel #2
0
        public PostEffect()
        {
            SwigObject = Engine.ObjectSystemFactory.CreatePostEffect();

            var p = SwigObject.GetPtr();
            if (GC.PostEffects.GetObject(p) != null)
            {
                Particular.Helper.ThrowException("");
            }
            GC.PostEffects.AddObject(p, this);
        }
Beispiel #3
0
        public PostEffect()
        {
            SwigObject = Engine.ObjectSystemFactory.CreatePostEffect();

            var p = SwigObject.GetPtr();

            if (GC.PostEffects.GetObject(p) != null)
            {
                Particular.Helper.ThrowException("");
            }
            GC.PostEffects.AddObject(p, this);
        }
Beispiel #4
0
        public PostEffect()
        {
            SwigObject = Engine.ObjectSystemFactory.CreatePostEffect();

            var p = SwigObject.GetPtr();

            if (GC.PostEffects.GetObject(p) != null)
            {
                throw new Exception();
            }
            GC.PostEffects.AddObject(p, this);
        }
Beispiel #5
0
 /// <summary>
 /// 強制的に使用しているメモリを開放する。
 /// </summary>
 /// <remarks>
 /// 何らかの理由でメモリが不足した場合に実行する。
 /// 開放した後の動作の保証はしていないので、必ず参照が残っていないことを確認する必要がある。
 /// </remarks>
 public void ForceToRelease()
 {
     lock (this)
     {
         if (SwigObject == null)
         {
             return;
         }
         GC.Collector.AddObject(SwigObject);
         SwigObject = null;
     }
     Particular.GC.SuppressFinalize(this);
 }
Beispiel #6
0
 public void Destroy()
 {
     lock (this)
     {
         if (SwigObject == null)
         {
             return;
         }
         GC.Collector.AddObject(SwigObject);
         SwigObject = null;
     }
     System.GC.SuppressFinalize(this);
 }
Beispiel #7
0
        public PostEffect()
        {
            coreInstance = Engine.ObjectSystemFactory.CreatePostEffect();

            var p = coreInstance.GetPtr();

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

            GC.PostEffects.AddObject(p, this);

            IsEnabled = true;
        }
Beispiel #8
0
        protected virtual void Dispose(bool disposing)
        {
            if (disposed)
            {
                return;
            }

            var core = coreInstance;

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

            disposed = true;
        }