Skip to content

Reloading engine does not reset static variables #1285

Description

@iche033

Description

See #1280 (review), 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Inbox

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions