From b850a8ea501903d4e69811be7ba60af5e748488c Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 22 May 2005 01:10:35 +0000 Subject: [PATCH] fix FlushDirCache() doesn't flush everything (NormalizePath("") results in "/") --- stepmania/src/RageFileManager.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/stepmania/src/RageFileManager.cpp b/stepmania/src/RageFileManager.cpp index dadabb190e..c50f4e4a62 100644 --- a/stepmania/src/RageFileManager.cpp +++ b/stepmania/src/RageFileManager.cpp @@ -576,23 +576,23 @@ void RageFileManager::GetLoadedDrivers( vector &Mounts ) void RageFileManager::FlushDirCache( CString sPath ) { - NormalizePath( sPath ); - LockMut( *g_Mutex ); + if( sPath == "" ) + { + for( unsigned i = 0; i < g_Drivers.size(); ++i ) + g_Drivers[i].driver->FlushDirCache( "" ); + return; + } + + /* Flush a specific path. */ + NormalizePath( sPath ); for( unsigned i = 0; i < g_Drivers.size(); ++i ) { - if( sPath.size() == 0 ) - { - g_Drivers[i].driver->FlushDirCache( "" ); - } - else - { - const CString path = g_Drivers[i].GetPath( sPath ); - if( path.size() == 0 ) - continue; - g_Drivers[i].driver->FlushDirCache( path ); - } + const CString path = g_Drivers[i].GetPath( sPath ); + if( path.size() == 0 ) + continue; + g_Drivers[i].driver->FlushDirCache( path ); } }