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++;