Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move DomainParticipant deletion from Impl to delete_participant() #2739

Closed
wants to merge 1 commit into from

Conversation

maloel
Copy link

@maloel maloel commented Jun 9, 2022

Signed-off-by: Eran [email protected]

Description

See #2537, #1906, etc.:

The singleton destructor of the DomainParticipantFactory is not the problem. Rather, the fact that it deletes all participants is. This PR makes it so it deletes their impl_ field, setting it to nullptr thereby invalidating existing participants so they do not crash, for example when someone then tries to delete_participant().

Fixes #937

This was tested locally where we see the issue. In the above scenario, the Factory is destroyed before our object, which then sees that the participant is no longer is_valid() and does not try to call the factory to delete_participant(). This, of course, has the side-effect of leaving the participant alive on process exit (so is a "memory leak") but this is much better than the crash that currently occurs and that cannot be avoided if things need destruction on exit.

Contributor Checklist

  • Commit messages follow the project guidelines.
  • The code follows the style guidelines of this project.
  • Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added.
  • Any new/modified methods have been properly documented using Doxygen.
  • Fast DDS test suite has been run locally.
  • Changes are ABI compatible.
  • Changes are API compatible.
  • Documentation builds and tests pass locally.
  • New feature has been added to the versions.md file (if applicable).
  • New feature has been documented/Current behavior is correctly described in the documentation.

Reviewer Checklist

  • Check contributor checklist is correct.
  • Check CI results: changes do not issue any warning.
  • Check CI results: failing tests are unrelated with the changes.

@JLBuenoLopez
Copy link
Contributor

Hi @maloel,

I am going to close this PR because it is not going to be merged following this comment. Thanks anyway for your contribution!

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.

Problems when creating/destructing participant in others static objects [8987]
2 participants