Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-06-29 02:55:47 +0300
committerCampbell Barton <campbell@blender.org>2022-06-29 03:11:01 +0300
commit6777c420dbb92523ca9c2acd1fa1f8abce98f88d (patch)
treede14e8696d9c6e8fca27449964f559bd6ac241fa /intern/mantaflow
parentd94d7a5d8f691426bfd6f32837f7e4387af51c9f (diff)
Mantaflow: call MANTA::terminateMantaflow on exit
terminateMantaflow was never called, this leak is more of a technicality since it's only called on exit. Also make Py_Initialize/Py_Finalize optional in Pd:setup/finalize as it caused Blender to crash, finalizing Python twice. Add a patch to extern/mantaflow to keep track of changes in Blender from up-stream.
Diffstat (limited to 'intern/mantaflow')
-rw-r--r--intern/mantaflow/intern/MANTA_main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/mantaflow/intern/MANTA_main.cpp b/intern/mantaflow/intern/MANTA_main.cpp
index 000bc313ab1..f1bdc10e7f9 100644
--- a/intern/mantaflow/intern/MANTA_main.cpp
+++ b/intern/mantaflow/intern/MANTA_main.cpp
@@ -562,6 +562,8 @@ MANTA::~MANTA()
pythonCommands.push_back(finalString);
result = runPythonString(pythonCommands);
+ MANTA::terminateMantaflow();
+
BLI_assert(result);
UNUSED_VARS(result);
}
@@ -692,7 +694,7 @@ void MANTA::initializeMantaflow()
PyObject *manta_main_module = manta_python_main_module_ensure();
PyObject *globals_dict = PyModule_GetDict(manta_main_module);
- Pb::setup(filename, fill, globals_dict); /* Namespace from Mantaflow (registry). */
+ Pb::setup(false, filename, fill, globals_dict); /* Namespace from Mantaflow (registry). */
PyGILState_Release(gilstate);
}
@@ -702,7 +704,7 @@ void MANTA::terminateMantaflow()
cout << "Fluid: Releasing Mantaflow framework" << endl;
PyGILState_STATE gilstate = PyGILState_Ensure();
- Pb::finalize(); /* Namespace from Mantaflow (registry). */
+ Pb::finalize(false); /* Namespace from Mantaflow (registry). */
manta_python_main_module_clear();
PyGILState_Release(gilstate);
}