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

Mesh cleanup on destruction #807

Merged
merged 1 commit into from
Jan 19, 2023
Merged

Mesh cleanup on destruction #807

merged 1 commit into from
Jan 19, 2023

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Jan 18, 2023

Signed-off-by: Ian Chen [email protected]

🦟 Bug fix

Fixes #805

Summary

The code snippet in #805 identified a case in which a mesh is not properly destroyed when it goes out of scope, see code and comment below

        ignition::rendering::MeshPtr mesh_geom = scene.CreateMesh(descriptor);
        // the line below leaves the original `mesh_geom` dangling and we are not cleaning it up properly
        mesh_geom = scene.CreateMesh(descriptor);

This PR makes sure the Destroy function is called in the mesh destructor.

The mesh unit test is updated to cover the use case shown in #805

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@codecov
Copy link

codecov bot commented Jan 18, 2023

Codecov Report

Merging #807 (fd098f5) into ign-rendering6 (41be240) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@               Coverage Diff               @@
##           ign-rendering6     #807   +/-   ##
===============================================
  Coverage           77.83%   77.83%           
===============================================
  Files                 146      146           
  Lines               13416    13417    +1     
===============================================
+ Hits                10442    10443    +1     
  Misses               2974     2974           
Impacted Files Coverage Δ
ogre2/src/Ogre2Mesh.cc 89.51% <100.00%> (+0.07%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@Levi-Armstrong
Copy link
Contributor

Will and new release of rendering6 be created with this patch by chance?

@mjcarroll
Copy link
Contributor

Github is saying src/Mesh_TEST.cc has conflicts.

@iche033 iche033 changed the base branch from gz-rendering7 to ign-rendering6 January 18, 2023 21:58
@iche033
Copy link
Contributor Author

iche033 commented Jan 18, 2023

targeted wrong branch. Just updated.

@iche033 iche033 added 🏯 fortress Ignition Fortress and removed 🌱 garden Ignition Garden labels Jan 18, 2023
@iche033
Copy link
Contributor Author

iche033 commented Jan 18, 2023

we can do a patch / minor release afterwards.

@ahcorde ahcorde merged commit a0f22c8 into ign-rendering6 Jan 19, 2023
@ahcorde ahcorde deleted the fix_destroy_mesh branch January 19, 2023 08:26
@iche033
Copy link
Contributor Author

iche033 commented Jan 19, 2023

just made an ign-rendering 6.5.2 patch release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏯 fortress Ignition Fortress
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Loading same mesh twice segfaults with ogre2.
4 participants