diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/settings.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/settings.c b/src/core/settings.c index 09033bd9..2c886fdf 100644 --- a/src/core/settings.c +++ b/src/core/settings.c @@ -183,12 +183,17 @@ static void reprioritise_settings ( struct settings *settings ) { * @ret rc Return status code */ int register_settings ( struct settings *settings, struct settings *parent ) { + struct settings *old_settings; /* NULL parent => add to settings root */ assert ( settings != NULL ); if ( parent == NULL ) parent = &settings_root; + /* Remove any existing settings with the same name */ + if ( ( old_settings = find_child_settings ( parent, settings->name ) )) + unregister_settings ( old_settings ); + /* Add to list of settings */ ref_get ( settings->refcnt ); ref_get ( parent->refcnt ); |