Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ReleaseAllReferences()

unsafe void Microsoft.Xna.Framework.Graphics.DeviceResourceManager.ReleaseAllReferences ( ulong handle,
[MarshalAs(UnmanagedType.U1)] bool dispose )
inline

Definition at line 255 of file DeviceResourceManager.cs.

256 {
257 if (pSyncObject == null)
258 {
259 return;
260 }
261 bool lockTaken = false;
262 try
263 {
266 {
267 return;
268 }
269 ResourceData value = pResourceData[handle];
270 value.isDisposed = dispose;
271 if (dispose)
272 {
274 }
275 while (true)
276 {
277 int currentRefCount = value.CurrentRefCount;
278 if (currentRefCount <= 0)
279 {
280 break;
281 }
282 void* pComPtr = value.pComPtr;
283 uint num = ((delegate* unmanaged[Stdcall, Stdcall]<IntPtr, uint>)(int)(*(uint*)(*(int*)pComPtr + 8)))((nint)pComPtr);
284 value.CurrentRefCount = currentRefCount - 1;
285 }
286 value.pComPtr = null;
287 if (dispose)
288 {
290 }
291 else
292 {
294 }
295 }
296 finally
297 {
298 if (lockTaken)
299 {
301 }
302 }
303 }
void FireDestroyedEvent(string name, object tag)
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
static void Exit(object obj)
static void Enter(object obj)

References System.Collections.Generic.Dictionary< TKey, TValue >.ContainsKey(), System.Threading.Monitor.Enter(), System.Threading.Monitor.Exit(), Microsoft.Xna.Framework.Graphics.GraphicsDevice.FireDestroyedEvent(), Microsoft.Xna.Framework.Graphics.DeviceResourceManager.GetCachedName(), Microsoft.Xna.Framework.Graphics.DeviceResourceManager.GetCachedTag(), System.handle, Microsoft.Xna.Framework.Graphics.DeviceResourceManager.pParentDevice, Microsoft.Xna.Framework.Graphics.DeviceResourceManager.pResourceData, Microsoft.Xna.Framework.Graphics.DeviceResourceManager.pSyncObject, System.Collections.Generic.Dictionary< TKey, TValue >.Remove(), and System.value.

Referenced by Microsoft.Xna.Framework.Graphics.Effect.ReleaseNativeObject(), Microsoft.Xna.Framework.Graphics.IndexBuffer.ReleaseNativeObject(), Microsoft.Xna.Framework.Graphics.OcclusionQuery.ReleaseNativeObject(), Microsoft.Xna.Framework.Graphics.Texture2D.ReleaseNativeObject(), Microsoft.Xna.Framework.Graphics.Texture3D.ReleaseNativeObject(), Microsoft.Xna.Framework.Graphics.TextureCube.ReleaseNativeObject(), and Microsoft.Xna.Framework.Graphics.VertexBuffer.ReleaseNativeObject().