From 1ad87989e0f5536ccba7e6c8bf54563418d0b602 Mon Sep 17 00:00:00 2001 From: goat Date: Sat, 29 Jun 2024 00:38:56 +0200 Subject: [PATCH] api10 todo: remove public DalamudTextureWrap impl --- .../TextureWraps/DalamudTextureWrap.cs | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 Dalamud/Interface/Textures/TextureWraps/DalamudTextureWrap.cs diff --git a/Dalamud/Interface/Textures/TextureWraps/DalamudTextureWrap.cs b/Dalamud/Interface/Textures/TextureWraps/DalamudTextureWrap.cs deleted file mode 100644 index 668e5a177..000000000 --- a/Dalamud/Interface/Textures/TextureWraps/DalamudTextureWrap.cs +++ /dev/null @@ -1,46 +0,0 @@ -using Dalamud.Utility; - -using ImGuiScene; - -// ReSharper disable once CheckNamespace -namespace Dalamud.Interface.Internal; - -/// Safety harness for ImGuiScene textures that will defer destruction until the end of the frame. -[Obsolete($"Use {nameof(IDalamudTextureWrap)}.")] -[Api10ToDo(Api10ToDoAttribute.DeleteCompatBehavior)] -public class DalamudTextureWrap : IDalamudTextureWrap, IDeferredDisposable -{ - private readonly TextureWrap wrappedWrap; - - /// Initializes a new instance of the class. - /// The texture wrap to wrap. - internal DalamudTextureWrap(TextureWrap wrappingWrap) => this.wrappedWrap = wrappingWrap; - - /// Finalizes an instance of the class. - ~DalamudTextureWrap() => this.Dispose(false); - - /// - public IntPtr ImGuiHandle => this.wrappedWrap.ImGuiHandle; - - /// - public int Width => this.wrappedWrap.Width; - - /// - public int Height => this.wrappedWrap.Height; - - /// Queue the texture to be disposed once the frame ends. - public void Dispose() - { - this.Dispose(true); - GC.SuppressFinalize(this); - } - - /// Actually dispose the wrapped texture. - void IDeferredDisposable.RealDispose() => this.wrappedWrap.Dispose(); - - private void Dispose(bool disposing) - { - if (disposing) - Service.GetNullable()?.EnqueueDeferredDispose(this); - } -}