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 !711
parents f59c15bb 24b97bf9
No related merge requests found
...@@ -31,6 +31,7 @@ Matthias Markl ...@@ -31,6 +31,7 @@ Matthias Markl
Michael Kuron Michael Kuron
Nils Kohl Nils Kohl
Paulo Carvalho Paulo Carvalho
Philipp Suffa
Regina Ammer Regina Ammer
Sagar Dolas Sagar Dolas
Sebastian Eibl Sebastian Eibl
......
...@@ -87,10 +87,11 @@ namespace python_coupling { ...@@ -87,10 +87,11 @@ namespace python_coupling {
PythonCallback::PythonCallback( const std::string & fileOrModuleName, const std::string & functionName, const std::vector<std::string> & argv ) 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(); Manager::instance()->triggerInitialization();
exposedVars_ = make_shared<DictWrapper>();
callbackDict_ = make_shared<DictWrapper>();
namespace py = pybind11; namespace py = pybind11;
// Add empty callbacks module // Add empty callbacks module
...@@ -102,10 +103,11 @@ namespace python_coupling { ...@@ -102,10 +103,11 @@ namespace python_coupling {
PythonCallback::PythonCallback( const std::string & functionName ) PythonCallback::PythonCallback( const std::string & functionName )
: functionName_( functionName ), exposedVars_( new DictWrapper() ), callbackDict_( new DictWrapper() ) : functionName_( functionName )
{ {
Manager::instance()->triggerInitialization(); Manager::instance()->triggerInitialization();
exposedVars_ = make_shared<DictWrapper>();
callbackDict_ = make_shared<DictWrapper>();
// Add empty callbacks module // Add empty callbacks module
py::object callbackModule = py::module::import( "walberla_cpp.callbacks"); 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