chore: throw if TextureManagerTextureWrap is used beyond disposal

This commit is contained in:
goat 2023-08-08 22:04:30 +02:00
parent dc95d7e8de
commit 39e389080c
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B

View file

@ -574,7 +574,9 @@ internal class TextureManagerTextureWrap : IDalamudTextureWrap
}
/// <inheritdoc/>
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.");
/// <inheritdoc/>
public int Width { get; private set; }