Fixed a crash on Windows XP and older systems
git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1112 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
parent
c8d6432cb7
commit
51afa7e129
|
@ -105,7 +105,6 @@ public:
|
||||||
if ( SUCCEEDED( hr ) )
|
if ( SUCCEEDED( hr ) )
|
||||||
{
|
{
|
||||||
pEnumerator->RegisterEndpointNotificationCallback( this );
|
pEnumerator->RegisterEndpointNotificationCallback( this );
|
||||||
registered = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,9 +117,12 @@ public:
|
||||||
{
|
{
|
||||||
if ( InterlockedDecrement( ®istered ) == 0 )
|
if ( InterlockedDecrement( ®istered ) == 0 )
|
||||||
{
|
{
|
||||||
pEnumerator->UnregisterEndpointNotificationCallback( this );
|
if (pEnumerator)
|
||||||
pEnumerator->Release();
|
{
|
||||||
registered = false;
|
pEnumerator->UnregisterEndpointNotificationCallback( this );
|
||||||
|
pEnumerator->Release();
|
||||||
|
pEnumerator = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EnterCriticalSection( &lock );
|
EnterCriticalSection( &lock );
|
||||||
|
|
|
@ -103,7 +103,6 @@ public:
|
||||||
if ( SUCCEEDED( hr ) )
|
if ( SUCCEEDED( hr ) )
|
||||||
{
|
{
|
||||||
pEnumerator->RegisterEndpointNotificationCallback( this );
|
pEnumerator->RegisterEndpointNotificationCallback( this );
|
||||||
registered = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,9 +115,12 @@ public:
|
||||||
{
|
{
|
||||||
if ( InterlockedDecrement( ®istered ) == 0 )
|
if ( InterlockedDecrement( ®istered ) == 0 )
|
||||||
{
|
{
|
||||||
pEnumerator->UnregisterEndpointNotificationCallback( this );
|
if (pEnumerator)
|
||||||
pEnumerator->Release();
|
{
|
||||||
registered = false;
|
pEnumerator->UnregisterEndpointNotificationCallback( this );
|
||||||
|
pEnumerator->Release();
|
||||||
|
pEnumerator = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EnterCriticalSection( &lock );
|
EnterCriticalSection( &lock );
|
||||||
|
|
Loading…
Reference in New Issue