Skip to content

Commit 476beb0

Browse files
Make MathKeyboard IDisposable (#179)
* Dispose Timer in MathKeyboard
1 parent ed72190 commit 476beb0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

CSharpMath.Editor/MathKeyboard.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public enum MathKeyboardCaretState : byte {
1515
ShownThroughPlaceholder,
1616
Shown
1717
}
18-
public class MathKeyboard<TFont, TGlyph> where TFont : IFont<TGlyph> {
18+
public class MathKeyboard<TFont, TGlyph> : IDisposable where TFont : IFont<TGlyph> {
1919
protected Timer blinkTimer;
2020
public const double DefaultBlinkMilliseconds = 800;
2121
public MathKeyboard(TypesettingContext<TFont, TGlyph> context, TFont font, double blinkMilliseconds = DefaultBlinkMilliseconds) {
@@ -871,5 +871,8 @@ public void ClearHighlights() {
871871
RecreateDisplayFromMathList();
872872
RedrawRequested?.Invoke(this, EventArgs.Empty);
873873
}
874+
public void Dispose() {
875+
((IDisposable)blinkTimer).Dispose();
876+
}
874877
}
875878
}

0 commit comments

Comments
 (0)