public void Dispose() { if (_AudioSessionEvents != null) { Marshal.ThrowExceptionForHR(_AudioSessionControl2.UnregisterAudioSessionNotification(_AudioSessionEvents)); } }
/* added -> */ public void Dispose() { if (_AudioSessionControl != null) { if (_audioSessionEvents != null) { Marshal.ThrowExceptionForHR(_AudioSessionControl.UnregisterAudioSessionNotification(_audioSessionEvents)); } Marshal.ReleaseComObject(_AudioSessionControl); _audioSessionEvents = null; } }
public void UnregisterAudioSessionNotification(IAudioSessionEvents eventConsumer) { Marshal.ThrowExceptionForHR(_AudioSessionControl.UnregisterAudioSessionNotification(eventConsumer)); }