mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
Fix memory ownership on AddFontFromImGuiHeapAllocatedMemory (#1651)
This commit is contained in:
parent
34ed07ef1f
commit
ea43d65636
2 changed files with 24 additions and 1 deletions
|
|
@ -46,6 +46,9 @@ internal sealed partial class FontAtlasFactory
|
|||
|
||||
private class FontAtlasBuiltData : IRefCountable
|
||||
{
|
||||
// Field for debugging.
|
||||
private static int numActiveInstances;
|
||||
|
||||
private readonly List<IDalamudTextureWrap> wraps;
|
||||
private readonly List<IFontHandleSubstance> substances;
|
||||
|
||||
|
|
@ -73,6 +76,9 @@ internal sealed partial class FontAtlasFactory
|
|||
|
||||
this.Garbage.Add(() => ImGuiNative.ImFontAtlas_destroy(atlasPtr));
|
||||
this.IsBuildInProgress = true;
|
||||
|
||||
Interlocked.Increment(ref numActiveInstances);
|
||||
this.Garbage.Add(() => Interlocked.Decrement(ref numActiveInstances));
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue