Mutex Not Held During List Size Check
This commit is contained in:
@ -92,16 +92,19 @@ void reHDD::app_logic(void)
|
||||
|
||||
Drive *reHDD::getSelectedDrive()
|
||||
{
|
||||
mxDrives.lock();
|
||||
if (u16SelectedEntry < listDrives.size())
|
||||
{
|
||||
list<Drive>::iterator it = listDrives.begin();
|
||||
advance(it, u16SelectedEntry);
|
||||
it->u16DriveIndex = u16SelectedEntry;
|
||||
mxDrives.unlock();
|
||||
return &(*it);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger::logThis()->warning("selected drive not present");
|
||||
mxDrives.unlock();
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user