Sync the config file replacement to disk before renaming

Hopefully, this fixes player's incomplete config issues.
This commit is contained in:
heinrich5991 2022-01-31 22:08:56 +01:00
parent 4d90119f25
commit a51875f9b6

View file

@ -110,6 +110,11 @@ bool CConfigManager::Save()
for(int i = 0; i < m_NumCallbacks; i++) for(int i = 0; i < m_NumCallbacks; i++)
m_aCallbacks[i].m_pfnFunc(this, m_aCallbacks[i].m_pUserData); m_aCallbacks[i].m_pfnFunc(this, m_aCallbacks[i].m_pUserData);
if(io_sync(m_ConfigFile) != 0)
{
m_Failed = true;
}
if(io_close(m_ConfigFile) != 0) if(io_close(m_ConfigFile) != 0)
m_Failed = true; m_Failed = true;