Use a scoped_lock earlier in RemoveAdapter as checking m_adapters for a key runs into a theoretical conflict with RegisterAdapter touching it.

Silences coverity warning.
This commit is contained in:
Mark Roszko
2025-12-11 19:37:48 -05:00
parent 744406cda0
commit d4668d0d01
+1 -1
View File
@@ -509,13 +509,13 @@ void LIBRARY_MANAGER::RegisterAdapter( LIBRARY_TABLE_TYPE aType,
bool LIBRARY_MANAGER::RemoveAdapter( LIBRARY_TABLE_TYPE aType, LIBRARY_MANAGER_ADAPTER* aAdapter )
{
std::scoped_lock lock( m_adaptersMutex );
if( !m_adapters.contains( aType ) )
return false;
if( m_adapters[aType].get() != aAdapter )
return false;
std::scoped_lock lock( m_adaptersMutex );
m_adapters.erase( aType );
return true;
}