Unsubscribe IStreamable events from Disposed instead of FormClosed.

This commit is contained in:
Michael Bucari-Tovo 2021-08-21 08:46:15 -06:00
parent 3183f99153
commit f60964f4c7

View File

@ -48,7 +48,7 @@ namespace LibationWinForms.BookLiberation.BaseForms
streamable.StreamingCompleted += OnStreamingCompleted; streamable.StreamingCompleted += OnStreamingCompleted;
streamable.StreamingCompleted += OnStreamingCompletedClose; streamable.StreamingCompleted += OnStreamingCompletedClose;
FormClosed += UnsubscribeStreamable; Disposed += UnsubscribeStreamable;
} }
private void Subscribe(IProcessable processable) private void Subscribe(IProcessable processable)
{ {
@ -81,7 +81,7 @@ namespace LibationWinForms.BookLiberation.BaseForms
} }
private void UnsubscribeStreamable(object sender, EventArgs e) private void UnsubscribeStreamable(object sender, EventArgs e)
{ {
FormClosed -= UnsubscribeStreamable; Disposed -= UnsubscribeStreamable;
Streamable.StreamingBegin -= OnStreamingBeginShow; Streamable.StreamingBegin -= OnStreamingBeginShow;
Streamable.StreamingBegin -= OnStreamingBegin; Streamable.StreamingBegin -= OnStreamingBegin;