diff --git a/src/resource/ubridge.c b/src/resource/ubridge.c index f1aef4eb..a68d3f5c 100644 --- a/src/resource/ubridge.c +++ b/src/resource/ubridge.c @@ -3889,12 +3889,17 @@ static int _worker_init_fn(sid_resource_t *worker_res, void *arg) &sid_resource_type_kv_store, MAIN_KV_STORE_NAME))) return -ENOMEDIUM; + /* we take only inherited modules and kv_store for the worker */ (void) sid_resource_isolate_with_children(modules_res); (void) sid_resource_isolate_with_children(kv_store_res); (void) sid_resource_add_child(worker_res, modules_res, SID_RESOURCE_NO_FLAGS); (void) sid_resource_add_child(worker_res, kv_store_res, SID_RESOURCE_RESTRICT_WALK_UP); + + /* destroy the rest */ + (void) sid_resource_unref(sid_resource_search(ubridge_internal_res, SID_RESOURCE_SEARCH_TOP, NULL, NULL)); + return 0; } diff --git a/src/resource/worker-control.c b/src/resource/worker-control.c index 514f87ff..27fb1da9 100644 --- a/src/resource/worker-control.c +++ b/src/resource/worker-control.c @@ -705,9 +705,6 @@ sid_resource_t *worker_control_get_new_worker(sid_resource_t *worker_control_res if (worker_control->init_cb_spec.cb) (void) worker_control->init_cb_spec.cb(res, worker_control->init_cb_spec.arg); - - /* destroy the unneeded and inherited "sid" resource from parent */ - (void) sid_resource_unref(sid_resource_search(worker_control_res, SID_RESOURCE_SEARCH_TOP, NULL, NULL)); } else { /* * WORKER_TYPE_EXTERNAL