gazebosim / gazebosim/gz-rendering
Reloading engine does not reset static variables
- Dominant language
- C++
- Stars
- 81
- Forks
- 90
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 10
Description
## Description
See https://github.com/gazebosim/gz-rendering/pull/1280#pullrequestreview-4190639282, specifically:
> Checking with `nm -SlC lib/libgz-rendering-ogre2.dylib | grep -F ' b ' | v`, I see the following non-const variables that will not be reinitialized:
> ```
> gz::rendering::v11::Ogre2RenderTarget::TargetFSAA(unsigned char)::ogre2FSAAWarn
> gz::rendering::v11::Ogre2DynamicRenderable::CreateDynamicMesh()::dynamicRenderableId
> gz::rendering::v11::Ogre2GaussianNoisePass::CreateRenderPass()::gaussianNodeCounter
> gz::rendering::v11::Ogre2DepthGaussianNoisePass::CreateRenderPass()::gaussianDepthNodeCounter
> ```
> and the following static initializers that affect singletons from https://github.com/gazebosim/gz-rendering/blob/15a0455307f002e9a5e1415198ebbd7ab5731c1b/include/gz/rendering/RenderPassSystem.hh#L97> :
> ```
> global_Ogre2LensFlarePassFactory
> global_Ogre2GaussianNoisePassFactory
> ```
We may have to reset these variables when engine is unloaded and reloaded.
Contributor guide
Assessment
This issue has not been assessed yet.