Index: src/ch/FeedbackNotEnoughSpaceDlg.cpp =================================================================== diff -u -r3c248d4f6d0fdb1e487cc868b2f0b219eec37ef4 -ra6b040ed1b328ac7ad30882b07b7ca41e812bbb9 --- src/ch/FeedbackNotEnoughSpaceDlg.cpp (.../FeedbackNotEnoughSpaceDlg.cpp) (revision 3c248d4f6d0fdb1e487cc868b2f0b219eec37ef4) +++ src/ch/FeedbackNotEnoughSpaceDlg.cpp (.../FeedbackNotEnoughSpaceDlg.cpp) (revision a6b040ed1b328ac7ad30882b07b7ca41e812bbb9) @@ -143,10 +143,10 @@ if (nIDEvent == 1601) { // update free space - unsigned long long ullFree = 0, ullTotal = 0; CWnd *pWnd=GetDlgItem(IDC_AVAILABLE_STATIC); if (pWnd) { + unsigned long long ullFree = 0, ullTotal = 0; try { m_fsLocal.GetDynamicFreeSpace(chcore::PathFromString(m_strDisk), ullFree, ullTotal); Index: src/ch/FolderDialog.cpp =================================================================== diff -u -r3c248d4f6d0fdb1e487cc868b2f0b219eec37ef4 -ra6b040ed1b328ac7ad30882b07b7ca41e812bbb9 --- src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision 3c248d4f6d0fdb1e487cc868b2f0b219eec37ef4) +++ src/ch/FolderDialog.cpp (.../FolderDialog.cpp) (revision a6b040ed1b328ac7ad30882b07b7ca41e812bbb9) @@ -662,10 +662,10 @@ if (!bSkipFreeSpace) { // get disk free space - unsigned long long ullFree = 0, ullTotal = 0; - try { + unsigned long long ullFree = 0, ullTotal = 0; + m_fsLocal.GetDynamicFreeSpace(chcore::PathFromString(strPath), ullFree, ullTotal); m_strTip += GetResManager().LoadString(IDS_BDFREESPACE_STRING) + GetSizeString(ullFree, false) + _T("\n"); m_strTip += GetResManager().LoadString(IDS_BDCAPACITY_STRING) + GetSizeString(ullTotal, false) + _T("\n"); @@ -706,9 +706,10 @@ m_strTip=sc.m_strName+_T("\r\n")+CString(GetResManager().LoadString(IDS_BDPATH2_STRING))+sc.m_strPath; // get disk free space - unsigned long long ullFree = 0, ullTotal = 0; try { + unsigned long long ullFree = 0, ullTotal = 0; + m_fsLocal.GetDynamicFreeSpace(chcore::PathFromString(sc.m_strPath), ullFree, ullTotal); m_strTip += CString(_T("\r\n")) + GetResManager().LoadString(IDS_BDFREESPACE_STRING) + GetSizeString(ullFree, false) + _T("\n"); m_strTip += GetResManager().LoadString(IDS_BDCAPACITY_STRING) + GetSizeString(ullTotal, false); Index: src/ch/TShellExtensionConfig.h =================================================================== diff -u -r306fbe693c70290af9de9a5779084a697de22d75 -ra6b040ed1b328ac7ad30882b07b7ca41e812bbb9 --- src/ch/TShellExtensionConfig.h (.../TShellExtensionConfig.h) (revision 306fbe693c70290af9de9a5779084a697de22d75) +++ src/ch/TShellExtensionConfig.h (.../TShellExtensionConfig.h) (revision a6b040ed1b328ac7ad30882b07b7ca41e812bbb9) @@ -28,7 +28,7 @@ class TShellExtensionConfig { public: - TShellExtensionConfig(const logger::TLogFileDataPtr& spLogData); + explicit TShellExtensionConfig(const logger::TLogFileDataPtr& spLogData); void PrepareConfig(); Index: src/ch/TWindowMessageFilterHelper.cpp =================================================================== diff -u -r09cedb80782a75d4b4896a1f3d2dd535688bf840 -ra6b040ed1b328ac7ad30882b07b7ca41e812bbb9 --- src/ch/TWindowMessageFilterHelper.cpp (.../TWindowMessageFilterHelper.cpp) (revision 09cedb80782a75d4b4896a1f3d2dd535688bf840) +++ src/ch/TWindowMessageFilterHelper.cpp (.../TWindowMessageFilterHelper.cpp) (revision a6b040ed1b328ac7ad30882b07b7ca41e812bbb9) @@ -42,5 +42,5 @@ FreeLibrary(hMod); - return bResult != false; + return bResult != FALSE; } Index: src/chext/TContextMenuHandler.cpp =================================================================== diff -u -r3c248d4f6d0fdb1e487cc868b2f0b219eec37ef4 -ra6b040ed1b328ac7ad30882b07b7ca41e812bbb9 --- src/chext/TContextMenuHandler.cpp (.../TContextMenuHandler.cpp) (revision 3c248d4f6d0fdb1e487cc868b2f0b219eec37ef4) +++ src/chext/TContextMenuHandler.cpp (.../TContextMenuHandler.cpp) (revision a6b040ed1b328ac7ad30882b07b7ca41e812bbb9) @@ -115,9 +115,10 @@ if(bShowFreeSpace && spMenuItem->SpecifiesDestinationPath()) { - unsigned long long ullSize = 0, ullTotal = 0; try { + unsigned long long ullSize = 0, ullTotal = 0; + m_fsLocal.GetDynamicFreeSpace(spMenuItem->GetDestinationPathInfo().GetDefaultDestinationPath(), ullSize, ullTotal); wstrItemName += std::wstring(L" (") + spFormatter->GetSizeString(ullSize) + L")"; Index: src/libchcore/TIpcMutex.cpp =================================================================== diff -u -r306fbe693c70290af9de9a5779084a697de22d75 -ra6b040ed1b328ac7ad30882b07b7ca41e812bbb9 --- src/libchcore/TIpcMutex.cpp (.../TIpcMutex.cpp) (revision 306fbe693c70290af9de9a5779084a697de22d75) +++ src/libchcore/TIpcMutex.cpp (.../TIpcMutex.cpp) (revision a6b040ed1b328ac7ad30882b07b7ca41e812bbb9) @@ -35,15 +35,13 @@ TIpcMutex::~TIpcMutex() { - if(m_bLocked) - Unlock(); - - if(m_hMutex) - CloseHandle(m_hMutex); + Close(); } void TIpcMutex::CreateMutex(const wchar_t* pszName) { + Close(); + m_hMutex = ::CreateMutex(nullptr, FALSE, pszName); if(!m_hMutex) throw TCoreWin32Exception(eErr_CannotCreateMutex, GetLastError(), L"Cannot create mutex", LOCATION); @@ -76,4 +74,13 @@ ReleaseMutex(m_hMutex); m_bLocked = false; } + + void TIpcMutex::Close() + { + if (m_bLocked) + Unlock(); + + if (m_hMutex) + CloseHandle(m_hMutex); + } } Index: src/libchcore/TIpcMutex.h =================================================================== diff -u -r306fbe693c70290af9de9a5779084a697de22d75 -ra6b040ed1b328ac7ad30882b07b7ca41e812bbb9 --- src/libchcore/TIpcMutex.h (.../TIpcMutex.h) (revision 306fbe693c70290af9de9a5779084a697de22d75) +++ src/libchcore/TIpcMutex.h (.../TIpcMutex.h) (revision a6b040ed1b328ac7ad30882b07b7ca41e812bbb9) @@ -27,7 +27,7 @@ { public: TIpcMutex(); - TIpcMutex(const wchar_t* pszName); + explicit TIpcMutex(const wchar_t* pszName); ~TIpcMutex(); void CreateMutex(const wchar_t* pszName); @@ -36,6 +36,9 @@ void Unlock(); private: + void Close(); + + private: HANDLE m_hMutex = nullptr; bool m_bLocked = false; };