Skip to content

Commit

Permalink
Make MathKeyboard IDisposable (#179)
Browse files Browse the repository at this point in the history
* Dispose Timer in MathKeyboard
  • Loading branch information
charlesroddie authored Oct 24, 2020
1 parent ed72190 commit 476beb0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CSharpMath.Editor/MathKeyboard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public enum MathKeyboardCaretState : byte {
ShownThroughPlaceholder,
Shown
}
public class MathKeyboard<TFont, TGlyph> where TFont : IFont<TGlyph> {
public class MathKeyboard<TFont, TGlyph> : IDisposable where TFont : IFont<TGlyph> {
protected Timer blinkTimer;
public const double DefaultBlinkMilliseconds = 800;
public MathKeyboard(TypesettingContext<TFont, TGlyph> context, TFont font, double blinkMilliseconds = DefaultBlinkMilliseconds) {
Expand Down Expand Up @@ -871,5 +871,8 @@ public void ClearHighlights() {
RecreateDisplayFromMathList();
RedrawRequested?.Invoke(this, EventArgs.Empty);
}
public void Dispose() {
((IDisposable)blinkTimer).Dispose();
}
}
}

0 comments on commit 476beb0

Please sign in to comment.