mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
Need to remove before inserting. Todo: is there a replace?
This commit is contained in:
parent
503db9cc6f
commit
bcc887c0b1
1 changed files with 7 additions and 1 deletions
|
@ -126,7 +126,13 @@ void
|
|||
RelayConfigs::SetValueFor( const char* key, const char* value )
|
||||
{
|
||||
MutexLock ml( &m_values_mutex );
|
||||
/* Does this leak in the case where we're replacing a value? */
|
||||
|
||||
/* Remove any entry already there */
|
||||
map<const char*,const char*>::iterator iter = m_values.find(key);
|
||||
if ( iter != m_values.end() ) {
|
||||
m_values.erase(iter);
|
||||
}
|
||||
|
||||
m_values.insert( pair<const char*,const char*>(strdup(key),strdup(value) ) );
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue