Beispiel #1
0
        public void AddNewReference()
        {
            ConcurrentDictionary <string, int> refCountByName = new ConcurrentDictionary <string, int>();

            ReferenceCounting.IncrementReference(refCountByName, "memes");

            Assert.AreEqual(1, refCountByName["memes"]);
        }
Beispiel #2
0
 /// <summary>
 /// Increments the reference count and initializes <see cref="Id"/>.
 /// </summary>
 public GLObject(int id)
 {
     // We need a constructor to set the readonly field and preserve polymorphic behavior.
     Id = id;
     ReferenceCounting.IncrementReference(GLObjectManager.referenceCountByGLObject, new Tuple <GLObjectType, int>(ObjectType, Id));
 }