diff --git a/src/core/ddsc/src/dds_rhc_default.c b/src/core/ddsc/src/dds_rhc_default.c index 09989e0..0a373e7 100644 --- a/src/core/ddsc/src/dds_rhc_default.c +++ b/src/core/ddsc/src/dds_rhc_default.c @@ -1648,7 +1648,7 @@ static bool dds_rhc_default_store (struct ddsi_rhc * __restrict rhc_common, cons } /* If instance became disposed, add an invalid sample if there are no samples left */ - if (inst_became_disposed && inst->latest == NULL) + if (inst_became_disposed && (inst->latest == NULL || inst->latest->isread)) inst_set_invsample (rhc, inst, &trig_qc, ¬ify_data_available); update_inst (inst, wrinfo, true, sample->timestamp); diff --git a/src/core/ddsc/tests/reader_iterator.c b/src/core/ddsc/tests/reader_iterator.c index df1e4c1..945564c 100644 --- a/src/core/ddsc/tests/reader_iterator.c +++ b/src/core/ddsc/tests/reader_iterator.c @@ -55,7 +55,7 @@ #define MAX_SAMPLES 21 #define RDR_NOT_READ_CNT 11 -#define RDR_INV_READ_CNT 1 +#define RDR_INV_READ_CNT 2 int rdr_expected_long_2[RDR_NOT_READ_CNT] = { 0, 1, 2, 6, 7, 9, 11, 13, 14, 16, 19 }; /* Because we only read one sample at a time, only the first sample of an instance