fix roundtrip cleanup code trying to delete non-existent entities
Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
e040d61246
commit
098378cd89
2 changed files with 6 additions and 23 deletions
|
@ -13,7 +13,7 @@
|
|||
/* Forward declaration */
|
||||
|
||||
static dds_entity_t prepare_dds(dds_entity_t *writer, dds_entity_t *reader, dds_entity_t *readCond, dds_listener_t *listener);
|
||||
static void finalize_dds(dds_entity_t participant, dds_entity_t reader, dds_entity_t readCond);
|
||||
static void finalize_dds(dds_entity_t participant);
|
||||
|
||||
typedef struct ExampleTimeStats
|
||||
{
|
||||
|
@ -402,7 +402,7 @@ done:
|
|||
sigaction (SIGINT, &oldAction, 0);
|
||||
#endif
|
||||
|
||||
finalize_dds(participant, reader, readCond);
|
||||
finalize_dds(participant);
|
||||
|
||||
/* Clean up */
|
||||
exampleDeleteTimeStats (&roundTrip);
|
||||
|
@ -484,19 +484,9 @@ static dds_entity_t prepare_dds(dds_entity_t *wr, dds_entity_t *rd, dds_entity_t
|
|||
return participant;
|
||||
}
|
||||
|
||||
static void finalize_dds(dds_entity_t ppant, dds_entity_t rd, dds_entity_t rdcond)
|
||||
static void finalize_dds(dds_entity_t ppant)
|
||||
{
|
||||
dds_return_t status;
|
||||
|
||||
/* Disable callbacks */
|
||||
dds_set_enabled_status (rd, 0);
|
||||
|
||||
(void) dds_waitset_detach (waitSet, rdcond);
|
||||
status = dds_waitset_detach (waitSet, waitSet);
|
||||
DDS_ERR_CHECK (status, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
(void) dds_delete (rdcond);
|
||||
status = dds_delete (waitSet);
|
||||
DDS_ERR_CHECK (status, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
status = dds_delete (ppant);
|
||||
DDS_ERR_CHECK (status, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ static dds_entity_t waitSet;
|
|||
|
||||
/* Forward declarations */
|
||||
static dds_entity_t prepare_dds(dds_entity_t *writer, dds_entity_t *reader, dds_entity_t *readCond, dds_listener_t *listener);
|
||||
static void finalize_dds(dds_entity_t participant, dds_entity_t readCond, RoundTripModule_DataType data[MAX_SAMPLES]);
|
||||
static void finalize_dds(dds_entity_t participant, RoundTripModule_DataType data[MAX_SAMPLES]);
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
|
@ -131,23 +131,16 @@ int main (int argc, char *argv[])
|
|||
#endif
|
||||
|
||||
/* Clean up */
|
||||
finalize_dds(participant, readCond, data);
|
||||
finalize_dds(participant, data);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
static void finalize_dds(dds_entity_t participant, dds_entity_t readCond, RoundTripModule_DataType data[MAX_SAMPLES])
|
||||
static void finalize_dds(dds_entity_t participant, RoundTripModule_DataType data[MAX_SAMPLES])
|
||||
{
|
||||
dds_return_t status;
|
||||
(void)dds_waitset_detach (waitSet, readCond);
|
||||
status = dds_waitset_detach (waitSet, waitSet);
|
||||
DDS_ERR_CHECK (status, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
(void)dds_delete (readCond);
|
||||
status = dds_delete (waitSet);
|
||||
DDS_ERR_CHECK (status, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
status = dds_delete (participant);
|
||||
DDS_ERR_CHECK (status, DDS_CHECK_REPORT | DDS_CHECK_EXIT);
|
||||
|
||||
for (unsigned int i = 0; i < MAX_SAMPLES; i++)
|
||||
{
|
||||
RoundTripModule_DataType_free (&data[i], DDS_FREE_CONTENTS);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue