diff --git a/CSharpMath.Editor/MathKeyboard.cs b/CSharpMath.Editor/MathKeyboard.cs index f95a0904..acdde535 100644 --- a/CSharpMath.Editor/MathKeyboard.cs +++ b/CSharpMath.Editor/MathKeyboard.cs @@ -15,7 +15,7 @@ public enum MathKeyboardCaretState : byte { ShownThroughPlaceholder, Shown } - public class MathKeyboard where TFont : IFont { + public class MathKeyboard : IDisposable where TFont : IFont { protected Timer blinkTimer; public const double DefaultBlinkMilliseconds = 800; public MathKeyboard(TypesettingContext context, TFont font, double blinkMilliseconds = DefaultBlinkMilliseconds) { @@ -871,5 +871,8 @@ public void ClearHighlights() { RecreateDisplayFromMathList(); RedrawRequested?.Invoke(this, EventArgs.Empty); } + public void Dispose() { + ((IDisposable)blinkTimer).Dispose(); + } } }