mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-16 21:54:16 +01:00
Remove finalizer; cannot be finalized due to the use of GCHandle
This commit is contained in:
parent
683464ed2d
commit
a0b7f53b01
1 changed files with 0 additions and 11 deletions
|
|
@ -59,23 +59,12 @@ internal sealed unsafe class ImGuiClipboardConfig : IServiceType, IDisposable
|
||||||
((ImGuiClipboardConfig)GCHandle.FromIntPtr(userData).Target)!.GetClipboardTextImpl();
|
((ImGuiClipboardConfig)GCHandle.FromIntPtr(userData).Target)!.GetClipboardTextImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Finalizes an instance of the <see cref="ImGuiClipboardConfig"/> class.
|
|
||||||
/// </summary>
|
|
||||||
~ImGuiClipboardConfig() => this.ReleaseUnmanagedResources();
|
|
||||||
|
|
||||||
[SuppressMessage("ReSharper", "AssignNullToNotNullAttribute", Justification = "If it's null, it's crashworthy")]
|
[SuppressMessage("ReSharper", "AssignNullToNotNullAttribute", Justification = "If it's null, it's crashworthy")]
|
||||||
private static ImVectorWrapper<byte> ImGuiCurrentContextClipboardHandlerData =>
|
private static ImVectorWrapper<byte> ImGuiCurrentContextClipboardHandlerData =>
|
||||||
new((ImVector*)(ImGui.GetCurrentContext() + 0x5520));
|
new((ImVector*)(ImGui.GetCurrentContext() + 0x5520));
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
|
||||||
this.ReleaseUnmanagedResources();
|
|
||||||
GC.SuppressFinalize(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ReleaseUnmanagedResources()
|
|
||||||
{
|
{
|
||||||
if (!this.clipboardUserData.IsAllocated)
|
if (!this.clipboardUserData.IsAllocated)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue