Send py::Object as a reference to callback call (#169)
Sending the py::Object by value caused UB because multiple threads could copy the same object at the same time without the GIL. By sending the object by reference we eliminate UB and avoid UB.
This commit is contained in:
parent
542a324c96
commit
90a093bd95
@ -505,7 +505,7 @@ std::optional<py::ExceptionInfo> AddMultipleRecordsFromPython(mgp_result *result
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
void CallPythonProcedure(py::Object py_cb, const mgp_list *args, const mgp_graph *graph, mgp_result *result,
|
||||
void CallPythonProcedure(const py::Object &py_cb, const mgp_list *args, const mgp_graph *graph, mgp_result *result,
|
||||
mgp_memory *memory) {
|
||||
auto gil = py::EnsureGIL();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user