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

Remove ClearMaterialsCache call when a material is destroyed in ogre2 (backport #1110) #1111

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Feb 27, 2025

🦟 Bug fix

Summary

The material cache in Ogre2MeshFactory was introduced in #324 to clear material objects when a mesh is removed. Looking at the current state, this call should no longer be needed as we now have logic in Ogre2Material::Destroy function to destroy ogre internal material / texture objects (and also unregistering gz-rendering material objects) when they are not in use. So this PR removes the material cache and the the call to ClearMaterialCache function.

Note that we ran into an issue with the ClearMaterialsCache function. It clears materials by the name of the texture it contains. However, it's possible for multiple materials to use the same texture, and the current logic may incorrectly destroy the wrong material. Removing the call to ClearMaterialsCache resolves that issue.

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.


This is an automatic backport of pull request #1110 done by [Mergify](https://mergify.com).

…#1110)

Signed-off-by: Ian Chen <ichen@openrobotics.org>
(cherry picked from commit 597d889)
@iche033 iche033 merged commit 982316c into gz-rendering8 Feb 27, 2025
10 of 11 checks passed
@iche033 iche033 deleted the mergify/bp/gz-rendering8/pr-1110 branch February 27, 2025 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant