|
@@ -459,15 +459,22 @@ int register_settings ( struct settings *settings, struct settings *parent ) {
|
459
|
459
|
* @v settings Settings block
|
460
|
460
|
*/
|
461
|
461
|
void unregister_settings ( struct settings *settings ) {
|
|
462
|
+ struct settings *child;
|
|
463
|
+ struct settings *tmp;
|
|
464
|
+
|
|
465
|
+ /* Unregister child settings */
|
|
466
|
+ list_for_each_entry_safe ( child, tmp, &settings->children, siblings ) {
|
|
467
|
+ unregister_settings ( child );
|
|
468
|
+ }
|
462
|
469
|
|
463
|
470
|
DBGC ( settings, "Settings %p (\"%s\") unregistered\n",
|
464
|
471
|
settings, settings_name ( settings ) );
|
465
|
472
|
|
466
|
473
|
/* Remove from list of settings */
|
467
|
|
- ref_put ( settings->refcnt );
|
468
|
474
|
ref_put ( settings->parent->refcnt );
|
469
|
475
|
settings->parent = NULL;
|
470
|
476
|
list_del ( &settings->siblings );
|
|
477
|
+ ref_put ( settings->refcnt );
|
471
|
478
|
|
472
|
479
|
/* Apply potentially-updated settings */
|
473
|
480
|
apply_settings();
|