diff --git a/src/core/ddsi/include/ddsi/q_entity.h b/src/core/ddsi/include/ddsi/q_entity.h index 164d56b..488952a 100644 --- a/src/core/ddsi/include/ddsi/q_entity.h +++ b/src/core/ddsi/include/ddsi/q_entity.h @@ -328,7 +328,7 @@ struct proxy_endpoint_common struct proxy_endpoint_common *next_ep; /* next \ endpoint belonging to this proxy participant */ struct proxy_endpoint_common *prev_ep; /* prev / -- this is in arbitrary ordering */ struct nn_xqos *xqos; /* proxy endpoint QoS lives here; FIXME: local ones should have it moved to common as well */ - const struct ddsi_sertopic * topic; /* topic may be NULL: for built-ins, but also for never-yet matched proxies (so we don't have to know the topic; when we match, we certainly do know) */ + struct ddsi_sertopic * topic; /* topic may be NULL: for built-ins, but also for never-yet matched proxies (so we don't have to know the topic; when we match, we certainly do know) */ struct addrset *as; /* address set to use for communicating with this endpoint */ nn_guid_t group_guid; /* 0:0:0:0 if not available */ nn_vendorid_t vendor; /* cached from proxypp->vendor */ diff --git a/src/core/ddsi/src/q_entity.c b/src/core/ddsi/src/q_entity.c index b0638fb..3eca5ff 100644 --- a/src/core/ddsi/src/q_entity.c +++ b/src/core/ddsi/src/q_entity.c @@ -1795,7 +1795,7 @@ static void proxy_writer_add_connection (struct proxy_writer *pwr, struct reader goto already_matched; if (pwr->c.topic == NULL && rd->topic) - pwr->c.topic = rd->topic; + pwr->c.topic = ddsi_sertopic_ref (rd->topic); if (pwr->ddsi2direct_cb == 0 && rd->ddsi2direct_cb != 0) { pwr->ddsi2direct_cb = rd->ddsi2direct_cb; @@ -1910,7 +1910,7 @@ static void proxy_reader_add_connection (struct proxy_reader *prd, struct writer m->wr_guid = wr->e.guid; os_mutexLock (&prd->e.lock); if (prd->c.topic == NULL) - prd->c.topic = wr->topic; + prd->c.topic = ddsi_sertopic_ref (wr->topic); if (ut_avlLookupIPath (&prd_writers_treedef, &prd->writers, &wr->e.guid, &path)) { DDS_LOG(DDS_LC_DISCOVERY, " proxy_reader_add_connection(wr %x:%x:%x:%x prd %x:%x:%x:%x) - already connected\n", @@ -4055,6 +4055,7 @@ static void proxy_endpoint_common_fini (struct entity_common *e, struct proxy_en { unref_proxy_participant (c->proxypp, c); + ddsi_sertopic_unref (c->topic); nn_xqos_fini (c->xqos); os_free (c->xqos); unref_addrset (c->as);