Index: src/ch/ResourceManager.cpp =================================================================== diff -u -r6b00e83b41342f9045fbf2dd1e8654b43656ca4c -r7a096cad617f85582370a1c788c45442d39efc8c --- src/ch/ResourceManager.cpp (.../ResourceManager.cpp) (revision 6b00e83b41342f9045fbf2dd1e8654b43656ca4c) +++ src/ch/ResourceManager.cpp (.../ResourceManager.cpp) (revision 7a096cad617f85582370a1c788c45442d39efc8c) @@ -57,6 +57,30 @@ } } +void CLangData::Clear() +{ + delete [] m_pszFilename; + m_pszFilename = NULL; + delete [] m_pszLngName; + m_pszLngName = NULL; + delete [] m_pszBaseFile; + m_pszBaseFile = NULL; + delete [] m_pszFontFace; + m_pszFontFace = NULL; + delete [] m_pszHelpName; + m_pszHelpName = NULL; + delete [] m_pszAuthor; + m_pszAuthor = NULL; + delete [] m_pszVersion; + m_pszVersion = NULL; + + for(strings_map::iterator it = m_mStrings.begin(); it != m_mStrings.end(); it++) + { + delete [] (*it).second; + } + m_mStrings.clear(); +} + CLangData::CLangData(const CLangData& ld) : m_pszFilename(NULL), m_pszLngName(NULL), @@ -186,6 +210,9 @@ { try { + if(!bUpdate) + Clear(); + // load data from file icpf::config cfg(icpf::config::eIni); const uint_t uiLangName = cfg.register_string(_T("Info/Lang Name"), _t("")); @@ -254,7 +281,11 @@ m_bUpdating = bUpdate; m_uiSectionID = 0; if(!cfg.enum_properties(_t("*"), EnumAttributesCallback, this)) + { + m_bUpdating = false; return false; + } + m_bUpdating = false; if(!bUpdate) { Index: src/ch/ResourceManager.h =================================================================== diff -u -r37a273b73ad2ba80df122121bc36c7a11a5492bc -r7a096cad617f85582370a1c788c45442d39efc8c --- src/ch/ResourceManager.h (.../ResourceManager.h) (revision 37a273b73ad2ba80df122121bc36c7a11a5492bc) +++ src/ch/ResourceManager.h (.../ResourceManager.h) (revision 7a096cad617f85582370a1c788c45442d39efc8c) @@ -45,6 +45,7 @@ ~CLangData(); CLangData(const CLangData& ld); + void Clear(); // operations bool ReadInfo(PCTSTR pszFile); bool ReadTranslation(PCTSTR pszFile, bool bUpdate=false); Index: src/ch/ch.cpp =================================================================== diff -u -r6b00e83b41342f9045fbf2dd1e8654b43656ca4c -r7a096cad617f85582370a1c788c45442d39efc8c --- src/ch/ch.cpp (.../ch.cpp) (revision 6b00e83b41342f9045fbf2dd1e8654b43656ca4c) +++ src/ch/ch.cpp (.../ch.cpp) (revision 7a096cad617f85582370a1c788c45442d39efc8c) @@ -225,6 +225,17 @@ BOOL CCopyHandlerApp::InitInstance() { + // InitCommonControlsEx() is required on Windows XP if an application + // manifest specifies use of ComCtl32.dll version 6 or later to enable + // visual styles. Otherwise, any window creation will fail. + INITCOMMONCONTROLSEX InitCtrls; + InitCtrls.dwSize = sizeof(InitCtrls); + // Set this to include all the common control classes you want to use + // in your application. + InitCtrls.dwICC = ICC_WIN95_CLASSES; + InitCommonControlsEx(&InitCtrls); + + // set the exception handler to catch the crash dumps SetUnhandledExceptionFilter(&MyUnhandledExceptionFilter); CWinApp::InitInstance();