From 6f73419b905539356852f5314ee1f80e365a68b3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 20 Jan 2006 00:55:52 +0000 Subject: [PATCH] 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 --- src/common/config.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index 22037a2cdd..8e5572cf39 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -225,8 +225,9 @@ bool wxConfigBase::DoWriteBool(const wxString& key, bool value) // ---------------------------------------------------------------------------- wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer, - const wxString& strEntry) + const wxString& strEntry) { + m_bChanged = false; m_pContainer = (wxConfigBase *)pContainer; // the path is everything which precedes the last slash @@ -243,7 +244,7 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer, { if ( m_pContainer->GetPath() != strPath ) { - // do change the path + // we do change the path so restore it later m_bChanged = true; /* JACS: work around a memory bug that causes an assert @@ -268,7 +269,6 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer, } else { // it's a name only, without path - nothing to do - m_bChanged = false; m_strName = strEntry; } }