Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Plugin/src/SofaPython3/PythonEnvironment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,9 @@ void PythonEnvironment::setArguments(const std::string& filename, const std::vec
PySys_SetArgvEx( data->size(), data->getDataBuffer(), 0);
}

void PythonEnvironment::SceneLoaderListerner::rightBeforeLoadingScene()
void PythonEnvironment::SceneLoaderListerner::rightBeforeLoadingScene(SceneLoader* sceneLoader)
{
SOFA_UNUSED(sceneLoader);
// unload python modules to force importing their eventual modifications
executePython([]{ PyRun_SimpleString("SofaRuntime.unloadModules()");});
}
Expand Down
3 changes: 1 addition & 2 deletions Plugin/src/SofaPython3/PythonEnvironment.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ class SOFAPYTHON3_API PythonEnvironment
/// to be able to react when a scene is loaded
struct SceneLoaderListerner : public SceneLoader::Listener
{
using SceneLoader::Listener::rightBeforeLoadingScene;
/// possibly unload python modules to force importing their eventual modifications
virtual void rightBeforeLoadingScene();
virtual void rightBeforeLoadingScene(SceneLoader* sceneLoader) override;
static SceneLoaderListerner* getInstance() {
static SceneLoaderListerner sceneLoaderListerner;
return &sceneLoaderListerner; }
Expand Down
Loading