X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b11dd16306b272d16fa69721584cd1e57b524c5f..5767e836997b965b9d936f1d65244bb886c39025:/src/common/config.cpp?ds=sidebyside diff --git a/src/common/config.cpp b/src/common/config.cpp index 30ca1fa2e7..f2d95677a4 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -246,7 +246,19 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer, { // do change the path m_bChanged = true; - m_strOldPath = m_pContainer->GetPath(); + + /* JACS: work around a memory bug that causes an assert + when using wxRegConfig, related to reference-counting. + Can be reproduced by removing (const wxChar*) below and + adding the following code to the config sample OnInit under + Windows: + + pConfig->SetPath(wxT("MySettings")); + pConfig->SetPath(wxT("..")); + int value; + pConfig->Read(_T("MainWindowX"), & value); + */ + m_strOldPath = (const wxChar*) m_pContainer->GetPath(); if ( *m_strOldPath.c_str() != wxCONFIG_PATH_SEPARATOR ) m_strOldPath += wxCONFIG_PATH_SEPARATOR; m_pContainer->SetPath(strPath);