Commit a6172bb7 authored by Wayne Stambaugh's avatar Wayne Stambaugh

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.
parent c9a917ee
......@@ -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;
}
......
......@@ -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() );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment