mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Clear ImDrawListSplitter when disposing SeStringDrawState
This commit is contained in:
parent
a39763f161
commit
0b55dc3e10
2 changed files with 6 additions and 2 deletions
|
|
@ -170,7 +170,7 @@ internal class SeStringRenderer : IServiceType
|
||||||
|
|
||||||
// This also does argument validation for drawParams. Do it here.
|
// This also does argument validation for drawParams. Do it here.
|
||||||
// `using var` makes a struct read-only, but we do want to modify it.
|
// `using var` makes a struct read-only, but we do want to modify it.
|
||||||
var stateStorage = new SeStringDrawState(
|
using var stateStorage = new SeStringDrawState(
|
||||||
sss,
|
sss,
|
||||||
drawParams,
|
drawParams,
|
||||||
ThreadSafety.IsMainThread ? this.colorStackSetMainThread : new(this.colorStackSetMainThread.ColorTypes),
|
ThreadSafety.IsMainThread ? this.colorStackSetMainThread : new(this.colorStackSetMainThread.ColorTypes),
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Utility;
|
using Dalamud.Utility;
|
||||||
|
|
||||||
using FFXIVClientStructs.FFXIV.Component.GUI;
|
using FFXIVClientStructs.FFXIV.Component.GUI;
|
||||||
|
|
||||||
using Lumina.Text.Payloads;
|
using Lumina.Text.Payloads;
|
||||||
using Lumina.Text.ReadOnly;
|
using Lumina.Text.ReadOnly;
|
||||||
|
|
||||||
|
|
@ -17,7 +18,7 @@ namespace Dalamud.Interface.ImGuiSeStringRenderer;
|
||||||
|
|
||||||
/// <summary>Calculated values from <see cref="SeStringDrawParams"/> using ImGui styles.</summary>
|
/// <summary>Calculated values from <see cref="SeStringDrawParams"/> using ImGui styles.</summary>
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
public unsafe ref struct SeStringDrawState
|
public unsafe ref struct SeStringDrawState : IDisposable
|
||||||
{
|
{
|
||||||
private static readonly int ChannelCount = Enum.GetValues<SeStringDrawChannel>().Length;
|
private static readonly int ChannelCount = Enum.GetValues<SeStringDrawChannel>().Length;
|
||||||
|
|
||||||
|
|
@ -194,6 +195,9 @@ public unsafe ref struct SeStringDrawState
|
||||||
/// <summary>Gets the text fragments.</summary>
|
/// <summary>Gets the text fragments.</summary>
|
||||||
internal List<TextFragment> Fragments { get; }
|
internal List<TextFragment> Fragments { get; }
|
||||||
|
|
||||||
|
/// <inheritdoc/>
|
||||||
|
public void Dispose() => this.splitter.ClearFreeMemory();
|
||||||
|
|
||||||
/// <summary>Sets the current channel in the ImGui draw list splitter.</summary>
|
/// <summary>Sets the current channel in the ImGui draw list splitter.</summary>
|
||||||
/// <param name="channelIndex">Channel to switch to.</param>
|
/// <param name="channelIndex">Channel to switch to.</param>
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue