using System; using Avalonia.Platform; using Avalonia.Utilities; namespace Avalonia.Media; public interface IImmutableGlyphRunReference : IDisposable { internal IRef? GlyphRun { get; } } internal class ImmutableGlyphRunReference : IImmutableGlyphRunReference { public ImmutableGlyphRunReference(IRef? glyphRun) { GlyphRun = glyphRun; } public IRef? GlyphRun { get; private set; } public void Dispose() { GlyphRun?.Dispose(); GlyphRun = null; } }