[win32] CLog: Do not use FlushFileBuffers after each write to file which causes unnec...
authorAnton Fedchin <afedchin@ruswizards.com>
Mon, 20 Apr 2015 12:48:33 +0000 (15:48 +0300)
committerAnton Fedchin <afedchin@ruswizards.com>
Mon, 27 Apr 2015 20:39:20 +0000 (23:39 +0300)
xbmc/utils/win32/Win32InterfaceForCLog.cpp

index 6daf40f..9599669 100644 (file)
@@ -67,6 +67,7 @@ bool CWin32InterfaceForCLog::OpenLogFile(const std::string& logFilename, const s
   static const unsigned char BOM[3] = { 0xEF, 0xBB, 0xBF };
   DWORD written;
   (void)WriteFile(m_hFile, BOM, sizeof(BOM), &written, NULL); // write BOM, ignore possible errors
+  (void)FlushFileBuffers(m_hFile);
 
   return true;
 }
@@ -91,7 +92,6 @@ bool CWin32InterfaceForCLog::WriteStringToLog(const std::string& logString)
 
   DWORD written;
   const bool ret = (WriteFile(m_hFile, strData.c_str(), strData.length(), &written, NULL) != 0) && written == strData.length();
-  (void)FlushFileBuffers(m_hFile);
 
   return ret;
 }