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

Clean up internal resources on Destroy #886

Merged
merged 2 commits into from
Aug 28, 2023
Merged

Clean up internal resources on Destroy #886

merged 2 commits into from
Aug 28, 2023

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Aug 26, 2023

🦟 Bug fix

Summary

Motivated by gazebosim/gz-sim#2084.

Went through and clean up resources and pointers when the objects destroyed. This is is to make sure that we don't hold on to any pointers after the engine is destroyed.

More info:
We have ogre pointers as member variables in different rendering classes. The destructors are called when they go out of scope. If the engine is destroyed before the destructors are called, the destructor may be calling function from pointers that are no longer valid. So this PR tries to clear and reset all pointers when objects are destroyed (before the engine is unloaded).

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.

Signed-off-by: Ian Chen <ichen@openrobotics.org>
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Aug 26, 2023
@codecov
Copy link

codecov bot commented Aug 26, 2023

Codecov Report

Merging #886 (ecbbfef) into main (2286452) will increase coverage by 0.01%.
The diff coverage is 94.11%.

❗ Current head ecbbfef differs from pull request most recent head 874acb0. Consider uploading reports for the commit 874acb0 to get more accurate results

@@            Coverage Diff             @@
##             main     #886      +/-   ##
==========================================
+ Coverage   75.13%   75.15%   +0.01%     
==========================================
  Files         176      176              
  Lines       16835    16851      +16     
==========================================
+ Hits        12649    12664      +15     
- Misses       4186     4187       +1     
Files Changed Coverage Δ
ogre2/src/Ogre2SelectionBuffer.cc 96.28% <87.50%> (-0.29%) ⬇️
ogre2/src/Ogre2LensFlarePass.cc 99.31% <100.00%> (+0.02%) ⬆️
ogre2/src/Ogre2Material.cc 76.07% <100.00%> (+0.06%) ⬆️
ogre2/src/Ogre2RayQuery.cc 89.90% <100.00%> (+0.09%) ⬆️

@azeey azeey added the beta Targeting beta release of upcoming collection label Aug 26, 2023
Signed-off-by: Ian Chen <ichen@openrobotics.org>
@iche033 iche033 merged commit 09022e4 into main Aug 28, 2023
9 of 10 checks passed
@iche033 iche033 deleted the resource_cleanup branch August 28, 2023 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta Targeting beta release of upcoming collection 🎵 harmonic Gazebo Harmonic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants