diff options
Diffstat (limited to 'extern/mantaflow/helper/pwrapper/registry.cpp')
-rw-r--r-- | extern/mantaflow/helper/pwrapper/registry.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/extern/mantaflow/helper/pwrapper/registry.cpp b/extern/mantaflow/helper/pwrapper/registry.cpp index b20651f3baa..b4206a41dea 100644 --- a/extern/mantaflow/helper/pwrapper/registry.cpp +++ b/extern/mantaflow/helper/pwrapper/registry.cpp @@ -706,16 +706,23 @@ PyObject *WrapperRegistry::initModule() //****************************************************** // Register members and exposed functions -void setup(const std::string &filename, const std::vector<std::string> &args, PyObject *name_space) +void setup(const bool python_lifecycle, + const std::string &filename, + const std::vector<std::string> &args, + PyObject *name_space) { WrapperRegistry::instance().construct(filename, args); - Py_Initialize(); + if (python_lifecycle) { + Py_Initialize(); + } WrapperRegistry::instance().runPreInit(name_space); } -void finalize() +void finalize(const bool python_lifecycle) { - Py_Finalize(); + if (python_lifecycle) { + Py_Finalize(); + } WrapperRegistry::instance().cleanup(); } |