Don't try to free CLR memory

This commit is contained in:
goaaats 2025-12-04 02:04:27 +01:00
parent 1fe2d54128
commit 9bce0d33a6
2 changed files with 2 additions and 6 deletions

View file

@ -168,7 +168,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.
using var stateStorage = new SeStringDrawState( var stateStorage = new SeStringDrawState(
sss, sss,
drawParams, drawParams,
ThreadSafety.IsMainThread ? this.colorStackSetMainThread : new(this.colorStackSetMainThread.ColorTypes), ThreadSafety.IsMainThread ? this.colorStackSetMainThread : new(this.colorStackSetMainThread.ColorTypes),

View file

@ -17,7 +17,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 : IDisposable public unsafe ref struct SeStringDrawState
{ {
private static readonly int ChannelCount = Enum.GetValues<SeStringDrawChannel>().Length; private static readonly int ChannelCount = Enum.GetValues<SeStringDrawChannel>().Length;
@ -181,10 +181,6 @@ public unsafe ref struct SeStringDrawState : IDisposable
/// <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() =>
ImGuiNative.Destroy((ImDrawListSplitter*)Unsafe.AsPointer(ref this.splitter));
/// <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)]