Browse Source

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.
pull/3/head
Wayne Stambaugh 11 years ago
parent
commit
a6172bb72e
  1. 13
      common/dialogs/dialog_env_var_config.cpp
  2. 2
      common/pgm_base.cpp

13
common/dialogs/dialog_env_var_config.cpp

@ -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;
}

2
common/pgm_base.cpp

@ -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() );
}

Loading…
Cancel
Save