refactor common unmount code
This commit is contained in:
@@ -112,6 +112,7 @@ void MemoryCardDriverThreaded_Windows::MountThreadDoOneUpdate()
|
||||
CString sProfileDir = TEMP_MOUNT_POINT + PREFSMAN->m_sMemoryCardProfileSubdir + '/';
|
||||
profile.LoadEditableDataFromDir( sProfileDir );
|
||||
usbd.sName = profile.GetDisplayName();
|
||||
UnmountMountPoint( TEMP_MOUNT_POINT );
|
||||
}
|
||||
|
||||
vNewStorageDevices.push_back( usbd );
|
||||
@@ -136,17 +137,7 @@ void MemoryCardDriverThreaded_Windows::Mount( UsbStorageDevice* pDevice, CString
|
||||
{
|
||||
ASSERT( !pDevice->sOsMountDir.empty() );
|
||||
|
||||
/* Unmount any previous mounts for this mountpoint. */
|
||||
vector<RageFileManager::DriverLocation> Mounts;
|
||||
FILEMAN->GetLoadedDrivers( Mounts );
|
||||
for( unsigned i = 0; i < Mounts.size(); ++i )
|
||||
{
|
||||
if( Mounts[i].Type.CompareNoCase( "dir" ) )
|
||||
continue; // wrong type
|
||||
if( Mounts[i].MountPoint.CompareNoCase( sMountPoint ) )
|
||||
continue; // wrong mount point
|
||||
FILEMAN->Unmount( Mounts[i].Type, Mounts[i].Root, Mounts[i].MountPoint );
|
||||
}
|
||||
UnmountMountPoint( sMountPoint );
|
||||
|
||||
FILEMAN->Mount( "dir", pDevice->sOsMountDir, sMountPoint.c_str() );
|
||||
LOG->Trace( "FILEMAN->Mount %s %s", pDevice->sOsMountDir.c_str(), sMountPoint.c_str() );
|
||||
|
||||
Reference in New Issue
Block a user