Skip to content

shape_main: assign the participant factory member so the participant is deleted on exit - #109

Open
nyhnpya wants to merge 1 commit into
omg-dds:masterfrom
nyhnpya:fix/shape-main-delete-participant
Open

nyhnpya wants to merge 1 commit into
omg-dds:masterfrom
nyhnpya:fix/shape-main-delete-participant

Conversation

@nyhnpya

@nyhnpya nyhnpya commented Oct 2, 2026

Copy link
Copy Markdown

Fixes #108.

ShapeApplication::initialize() declared a local DomainParticipantFactory *dpf that shadowed the member of the same name, so the member stayed NULL and the destructor's if (dpf) dpf->delete_participant( dp ); never ran. Every shape_main exited with its DomainParticipant still alive.

This assigns the member instead of declaring a local. With the change, delete_participant is called on exit and returns RETCODE_OK, the middleware threads stop, and the process exits normally.

…is deleted on exit

ShapeApplication::initialize() declared a local `DomainParticipantFactory *dpf` that
shadowed the member of the same name. The member stayed NULL, so the destructor's

    if (dpf) dpf->delete_participant( dp );

never ran. Every shape_main exited with its DomainParticipant still alive: the participant
was never deleted, its middleware threads were never stopped, and peers were not told it
had left, so they kept it until its lease expired.

Assign the member instead of declaring a local.

@angelrti angelrti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!

@angelrti

angelrti commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Before merging, we need the CLA as well (https://github.com/omg-dds/dds-rtps/tree/master/CLA) thanks Mark!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shape_main never deletes its DomainParticipant: a local dpf shadows the member

2 participants