Skip to content

Commit

Permalink
chore: throw if TextureManagerTextureWrap is used beyond disposal
Browse files Browse the repository at this point in the history
  • Loading branch information
goaaats committed Aug 8, 2023
1 parent dc95d7e commit 39e3890
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dalamud/Interface/Internal/TextureManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,9 @@ internal TextureManagerTextureWrap(string path, Vector2 extents, bool keepAlive,
}

/// <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; }
Expand Down

0 comments on commit 39e3890

Please sign in to comment.