From 158d4f825a7f45ad0346283ea582ab48081872c9 Mon Sep 17 00:00:00 2001 From: Ismo Puustinen Date: Thu, 29 Nov 2012 16:18:31 +0200 Subject: [PATCH] resource-asm: fixed the special resource unregister case. --- src/plugins/plugin-resource-asm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/plugin-resource-asm.c b/src/plugins/plugin-resource-asm.c index fbfc39d..9001bf0 100644 --- a/src/plugins/plugin-resource-asm.c +++ b/src/plugins/plugin-resource-asm.c @@ -237,7 +237,8 @@ static void htbl_free_set(void *key, void *object) MRP_UNUSED(key); - mrp_resource_set_destroy(d->rset); + if (d->rset) + mrp_resource_set_destroy(d->rset); mrp_free(d); } @@ -565,7 +566,7 @@ static asm_to_lib_t *process_msg(lib_to_asm_t *msg, asm_data_t *ctx) resource_set_data_t *d; d = mrp_htbl_lookup(client->sets, u_to_p(msg->handle)); - if (!d || !d->rset) { + if (!d) { mrp_log_error("set '%u.%u' not found", pid, msg->handle); goto error; } @@ -574,6 +575,9 @@ static asm_to_lib_t *process_msg(lib_to_asm_t *msg, asm_data_t *ctx) /* this is a resource request with no associated * murphy resource, meaning a monitor or earjack. */ + mrp_log_info("unregistering special resource %s", + d->monitor ? "monitor" : "earjack"); + if (d->monitor) client->monitor = FALSE; -- 2.7.4