Пример #1
0
 public static void DrainQueue <T>(Queue <T> queue)
     where T : IVoltPoolable <T>
 {
     while (queue.Count > 0)
     {
         VoltPool.Free(queue.Dequeue());
     }
 }
Пример #2
0
 private void ClearContacts()
 {
     for (int i = 0; i < this.used; i++)
     {
         VoltPool.Free(this.contacts[i]);
     }
     this.used = 0;
 }
Пример #3
0
 public static void SafeReplace <T>(ref T destination, T obj)
     where T : IVoltPoolable <T>
 {
     if (destination != null)
     {
         VoltPool.Free(destination);
     }
     destination = obj;
 }