Skip to content

Commit f406037

Browse files
committed
Added disposed guards for clear and restore
1 parent 34452fb commit f406037

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Serilog.Sinks.RichTextBox.WinForms.Colored/Sinks/RichTextBoxForms/RichTextBoxSink.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,22 @@ public void Emit(LogEvent logEvent)
8181

8282
public void Clear()
8383
{
84+
if (_disposed)
85+
{
86+
return;
87+
}
88+
8489
_buffer.Clear();
8590
_signal.Set();
8691
}
8792

8893
public void Restore()
8994
{
95+
if (_disposed)
96+
{
97+
return;
98+
}
99+
90100
_buffer.Restore();
91101
_signal.Set();
92102
}

0 commit comments

Comments
 (0)