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

import Sofa does not cleanup #429

Closed
alxbilger opened this issue Jul 23, 2024 · 1 comment · Fixed by #432
Closed

import Sofa does not cleanup #429

alxbilger opened this issue Jul 23, 2024 · 1 comment · Fixed by #432

Comments

@alxbilger
Copy link
Contributor

alxbilger commented Jul 23, 2024

Consider the following Python code:

import Sofa
import json

if __name__ == "__main__":
    object_factory = json.loads(Sofa.Core.ObjectFactory.dump_json())

It warns at the end of the program:

[WARNING] [Sofa.Simulation.Graph] the library has not been cleaned up (sofa::simulation::graph::cleanup() has never been called, see sofa/helper/init.h)
[WARNING] [SofaSimulationCommon] the library has not been cleaned up (sofa::simulation::common::cleanup() has never been called, see sofa/helper/init.h)
[WARNING] [SofaSimulationCore] the library has not been cleaned up (sofa::simulation::core::cleanup() has never been called, see sofa/helper/init.h)
[WARNING] [SofaCore] the library has not been cleaned up (sofa::core::cleanup() has never been called, see sofa/helper/init.h)
[WARNING] [SofaDefaultType] the library has not been cleaned up (sofa::defaulttype::cleanup() has never been called, see sofa/helper/init.h)
[WARNING] [SofaHelper] the library has not been cleaned up (sofa::helper::cleanup() has never been called, see sofa/helper/init.h)

I can remove this warning with import SofaRuntime. This is because there is a static object of the class SofaInitializer that initialize and clean. But it is only in SofaRuntime. Should it be moved into the Sofa module (if possible)?

@hugtalbot
Copy link
Contributor

I would naively say "yes"

@bakpaul @damienmarchal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants