Fixed a crash on Windows XP and older systems
This commit is contained in:
parent
7944d44390
commit
4178854b85
|
@ -105,7 +105,6 @@ public:
|
|||
if ( SUCCEEDED( hr ) )
|
||||
{
|
||||
pEnumerator->RegisterEndpointNotificationCallback( this );
|
||||
registered = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,9 +117,12 @@ public:
|
|||
{
|
||||
if ( InterlockedDecrement( ®istered ) == 0 )
|
||||
{
|
||||
pEnumerator->UnregisterEndpointNotificationCallback( this );
|
||||
pEnumerator->Release();
|
||||
registered = false;
|
||||
if (pEnumerator)
|
||||
{
|
||||
pEnumerator->UnregisterEndpointNotificationCallback( this );
|
||||
pEnumerator->Release();
|
||||
pEnumerator = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
EnterCriticalSection( &lock );
|
||||
|
|
|
@ -103,7 +103,6 @@ public:
|
|||
if ( SUCCEEDED( hr ) )
|
||||
{
|
||||
pEnumerator->RegisterEndpointNotificationCallback( this );
|
||||
registered = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,9 +115,12 @@ public:
|
|||
{
|
||||
if ( InterlockedDecrement( ®istered ) == 0 )
|
||||
{
|
||||
pEnumerator->UnregisterEndpointNotificationCallback( this );
|
||||
pEnumerator->Release();
|
||||
registered = false;
|
||||
if (pEnumerator)
|
||||
{
|
||||
pEnumerator->UnregisterEndpointNotificationCallback( this );
|
||||
pEnumerator->Release();
|
||||
pEnumerator = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
EnterCriticalSection( &lock );
|
||||
|
|
Loading…
Reference in New Issue