From 39e389080ce515ecc85511f40beeeec247de6522 Mon Sep 17 00:00:00 2001 From: goat Date: Tue, 8 Aug 2023 22:04:30 +0200 Subject: [PATCH] chore: throw if TextureManagerTextureWrap is used beyond disposal --- Dalamud/Interface/Internal/TextureManager.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dalamud/Interface/Internal/TextureManager.cs b/Dalamud/Interface/Internal/TextureManager.cs index a7c5a005e..717bd8081 100644 --- a/Dalamud/Interface/Internal/TextureManager.cs +++ b/Dalamud/Interface/Internal/TextureManager.cs @@ -574,7 +574,9 @@ internal class TextureManagerTextureWrap : IDalamudTextureWrap } /// - public IntPtr ImGuiHandle => this.manager.GetInfo(this.path).Wrap!.ImGuiHandle; + public IntPtr ImGuiHandle => !this.IsDisposed ? + this.manager.GetInfo(this.path).Wrap!.ImGuiHandle : + throw new InvalidOperationException("Texture already disposed. You may not render it."); /// public int Width { get; private set; }