Пример #1
0
 public static void Shutdown()
 {
     ObjectDictionary.Clear();
     ObjectNameDictionary.Clear();
     foreach (KeyValuePair <IntPtr, IntPtr> pair in ObjectWrapperDictionary)
     {
         unsafe
         {
             Sim.DeleteObjectPtr((Sim.SimObjectPtr *)pair.Value);
         }
     }
     ObjectWrapperDictionary.Clear();
     ObjectWrapperCountDictionary.Clear();
 }
Пример #2
0
 public static unsafe void UnregisterObjectPtr(IntPtr objectPtr)
 {
     if (!ObjectWrapperDictionary.ContainsKey(objectPtr))
     {
         return;
     }
     Debug.Assert(ObjectWrapperCountDictionary[objectPtr] >= 0);
     ObjectWrapperCountDictionary[objectPtr]--;
     if (ObjectWrapperCountDictionary[objectPtr] <= 0)
     {
         Sim.DeleteObjectPtr((Sim.SimObjectPtr *)ObjectWrapperDictionary[objectPtr]);
         ObjectWrapperDictionary.Remove(objectPtr);
         ObjectWrapperCountDictionary.Remove(objectPtr);
     }
 }