From 63df8cb38d24e6eea96f0bc2bddb70ccf72d8683 Mon Sep 17 00:00:00 2001 From: Dennis Potman Date: Thu, 21 Nov 2019 16:59:00 +0100 Subject: [PATCH] Fix to prevent proxy writer from getting alive while deleting Signed-off-by: Dennis Potman --- src/core/ddsi/src/q_entity.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/ddsi/src/q_entity.c b/src/core/ddsi/src/q_entity.c index a199f63..b15b807 100644 --- a/src/core/ddsi/src/q_entity.c +++ b/src/core/ddsi/src/q_entity.c @@ -4598,6 +4598,13 @@ void proxy_writer_set_alive_may_unlock (struct proxy_writer *pwr, bool notify) heap). */ assert (!pwr->alive); + /* check that proxy writer still exists (when deleting it is removed from guid hash) */ + if (ephash_lookup_proxy_writer_guid (pwr->e.gv->guid_hash, &pwr->e.guid) == NULL) + { + ELOGDISC (pwr, "proxy_writer_set_alive_may_unlock("PGUIDFMT") - not in guid_hash, pwr deleting\n", PGUID (pwr->e.guid)); + return; + } + ddsrt_mutex_lock (&pwr->c.proxypp->e.lock); pwr->alive = true; pwr->alive_vclock++;