Skip to content
Snippets Groups Projects
Commit 4bcc110e authored by Frederik Hennig's avatar Frederik Hennig
Browse files

Merge branch 'suffa/python_callback_fix' into 'master'

Fixed Callback Segfault in the python coupling

See merge request walberla/walberla!711
parents f59c15bb 24b97bf9
Branches
No related merge requests found
......@@ -31,6 +31,7 @@ Matthias Markl
Michael Kuron
Nils Kohl
Paulo Carvalho
Philipp Suffa
Regina Ammer
Sagar Dolas
Sebastian Eibl
......
......@@ -87,10 +87,11 @@ namespace python_coupling {
PythonCallback::PythonCallback( const std::string & fileOrModuleName, const std::string & functionName, const std::vector<std::string> & argv )
: functionName_( functionName ), exposedVars_( new DictWrapper() ), callbackDict_( new DictWrapper() )
: functionName_( functionName )
{
Manager::instance()->triggerInitialization();
exposedVars_ = make_shared<DictWrapper>();
callbackDict_ = make_shared<DictWrapper>();
namespace py = pybind11;
// Add empty callbacks module
......@@ -102,10 +103,11 @@ namespace python_coupling {
PythonCallback::PythonCallback( const std::string & functionName )
: functionName_( functionName ), exposedVars_( new DictWrapper() ), callbackDict_( new DictWrapper() )
: functionName_( functionName )
{
Manager::instance()->triggerInitialization();
exposedVars_ = make_shared<DictWrapper>();
callbackDict_ = make_shared<DictWrapper>();
// Add empty callbacks module
py::object callbackModule = py::module::import( "walberla_cpp.callbacks");
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment