Minor path configuration code fixes.

* Fix bug (and Coverity error) when deleting environment variable map entries.
* Remove debug logging code inadvertently left over from development.
This commit is contained in:
Wayne Stambaugh 2015-03-31 11:46:31 -04:00
parent c9a917eef1
commit a6172bb72e
2 changed files with 7 additions and 8 deletions

View File

@ -56,8 +56,6 @@ DIALOG_ENV_VAR_CONFIG::DIALOG_ENV_VAR_CONFIG( wxWindow* aParent, const ENV_VAR_M
if( okButton )
SetDefaultItem( okButton );
wxLogDebug( wxT( "In DIALOG_ENV_VAR_CONFIG ctor." ) );
}
@ -174,6 +172,8 @@ bool DIALOG_ENV_VAR_CONFIG::TransferDataFromWindow()
}
}
std::vector< wxString > removeFromMap;
// Remove deleted entries from the map.
for( ENV_VAR_MAP_ITER it = m_envVarMap.begin(); it != m_envVarMap.end(); ++it )
{
@ -189,13 +189,12 @@ bool DIALOG_ENV_VAR_CONFIG::TransferDataFromWindow()
}
if( !found )
{
m_envVarMap.erase( it );
it--;
}
removeFromMap.push_back( it->first );
}
wxLogDebug( wxT( "In DIALOG_ENV_VAR_CONFIG::TransferDataFromWindow()." ) );
for( size_t i = 0; i < removeFromMap.size(); i++ )
m_envVarMap.erase( removeFromMap[i] );
return true;
}

View File

@ -798,7 +798,7 @@ void PGM_BASE::ConfigurePaths( wxWindow* aParent )
for( ENV_VAR_MAP_ITER it = envVarMap.begin(); it != envVarMap.end(); ++it )
{
wxLogDebug( wxT( "Environment variable %s=%s defined externally = %d" ),
wxLogTrace( traceEnvVars, wxT( "Environment variable %s=%s defined externally = %d" ),
GetChars( it->first ), GetChars( it->second.GetValue() ),
it->second.GetDefinedExternally() );
}