private void Form1_FormClosed(object sender, FormClosedEventArgs e) { try { _rtspDevice.Dispose(); _client.DeviceFound -= DeviceFound; _client.DeviceLost -= DeviceLost; _client.Dispose(); } catch (Exception exception) { Logger.Error(string.Format("{0}-{1}:{2}", "Form1", "Form1_FormClosed", exception)); } }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { _client.DeviceFound -= DeviceFound; _client.DeviceLost -= DeviceLost; _client.Dispose(); }