private void p_Disposed(object sender, EventArgs e) { FormMain.fActiveWebCams.Remove(new KeyValuePair <string, string>(fUser, MonikerName)); var distributor = Distributor; if (distributor != null) { Distributor = null; ActiveWebCams.Stop(MonikerName); distributor.Dispose(); } var enumerator = fEnumerator; if (enumerator != null) { fEnumerator = null; try { enumerator.Dispose(); } catch { } } base.OnClosed(e); }
static void Main() { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); using (var form = new FormMain()) Application.Run(); } finally { ActiveWebCams.Stop(); SoundEnumerator.Stop(); } }