public static void ReleaseRef()
 {
     lock (Monitor)
     {
         RefCount--;
         if (RefCount == 0)
         {
             PlaylistDelegates.FreeNativeCallbacks();
             SessionDelegates.FreeNativeCallbacks();
             PlaylistContainerDelegates.FreeNativeCallbacks();
         }
     }
 }
 public static void AddRef()
 {
     lock (Monitor)
     {
         if (RefCount == 0)
         {
             PlaylistDelegates.AllocNativeCallbacks();
             SessionDelegates.AllocNativeCallbacks();
             PlaylistContainerDelegates.AllocNativeCallbacks();
         }
         RefCount++;
     }
 }