always initialize m_bChanged in wxConfigPathChanger ctor; this could result in difficult to reproduce bugs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37005 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
d9f5d54a5a
commit
6f73419b90
@ -225,8 +225,9 @@ bool wxConfigBase::DoWriteBool(const wxString& key, bool value)
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer,
|
wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer,
|
||||||
const wxString& strEntry)
|
const wxString& strEntry)
|
||||||
{
|
{
|
||||||
|
m_bChanged = false;
|
||||||
m_pContainer = (wxConfigBase *)pContainer;
|
m_pContainer = (wxConfigBase *)pContainer;
|
||||||
|
|
||||||
// the path is everything which precedes the last slash
|
// the path is everything which precedes the last slash
|
||||||
@ -243,7 +244,7 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer,
|
|||||||
{
|
{
|
||||||
if ( m_pContainer->GetPath() != strPath )
|
if ( m_pContainer->GetPath() != strPath )
|
||||||
{
|
{
|
||||||
// do change the path
|
// we do change the path so restore it later
|
||||||
m_bChanged = true;
|
m_bChanged = true;
|
||||||
|
|
||||||
/* JACS: work around a memory bug that causes an assert
|
/* JACS: work around a memory bug that causes an assert
|
||||||
@ -268,7 +269,6 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// it's a name only, without path - nothing to do
|
// it's a name only, without path - nothing to do
|
||||||
m_bChanged = false;
|
|
||||||
m_strName = strEntry;
|
m_strName = strEntry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user