Skip to content

Commit

Permalink
Update CharacterTab.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
PassiveModding committed Jul 25, 2024
1 parent bad500d commit 09d4e09
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Meddle/Meddle.Plugin/UI/CharacterTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,19 @@ public void Draw()
}


private bool IsDisposed { get; set; }
public void Dispose()
{
log.LogInformation("Disposing CharacterTab");
exportUtil.OnLogEvent -= HandleExportLog;
foreach (var (_, textureImage) in textureCache)
if (!IsDisposed)
{
textureImage.Wrap.Dispose();
log.LogInformation("Disposing CharacterTab");
exportUtil.OnLogEvent -= HandleExportLog;
foreach (var (_, textureImage) in textureCache)
{
textureImage.Wrap.Dispose();
}
textureCache.Clear();
IsDisposed = true;
}
}

Expand Down

0 comments on commit 09d4e09

Please sign in to comment.