Closed digimezzo closed 8 years ago
The "error" occurs when you don't dispose the _client object correctly.
Indeed, calling Dispose() on the NotificationClient resolves the issue. By the way, it seems the above fix doesn't prevent the NullReferenceException. _deviceEnumerator is not disposed when it happens, UnregisterEndpointNotificationCallbackNative still gets called and we get this:
No I missed that commit :( It's resolved now. As far as I'm concerned, this issue can be closed.
I'm using MMNotificationClient to detect a change in the default audio device. When my class, which uses the MMNotificationClient object, gets disposed when closing my application, MMNotificationClient.Dispose() is called. During MMNotificationClient.Dispose() , this nullReferenceException occurs in class "MMDeviceEnumerator" during the return in this function:
I've created a sample application that illustrates it: WpfApplication1
Steps to reproduce:
=> the nullreferenceexception occurs