Ejemplo n.º 1
0
 protected virtual void Dispose(bool disposing)
 {
     if (_disposed)
     {
         return;
     }
     if (disposing)
     {
         if (_t != null)
         {
             _t.Release();
             _t = null;
         }
     }
     _disposed = true;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create a SharedRef from a previous SharedRef, incrementing the reference count.
 /// </summary>
 /// <param name="o"></param>
 public SharedRef(SharedRef <T> o)
 {
     o._t.Retain();
     _t = o._t;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create a SharedRef directly from an object. Only use this once per object.
 /// After that, create SharedRefs from previous SharedRefs.
 /// </summary>
 /// <param name="t"></param>
 public SharedRef(T t)
 {
     _t = new SharedRefCounter <T>(t);
     _t.Retain();
 }