From 1be40a1d5a66cf7f121791c177bdc44af3a2bd37 Mon Sep 17 00:00:00 2001 From: Shishlo Date: Fri, 27 Sep 2024 15:11:09 -0400 Subject: [PATCH] The Py_INCREF((PyObject *) pyMPI_Comm) was added inside the function for creating new Python MPI communicator. --- src/mpi/wrap_mpi_comm.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mpi/wrap_mpi_comm.cc b/src/mpi/wrap_mpi_comm.cc index d16cd81..9e4f98a 100644 --- a/src/mpi/wrap_mpi_comm.cc +++ b/src/mpi/wrap_mpi_comm.cc @@ -162,6 +162,7 @@ extern "C" { pyORBIT_MPI_Comm* newMPI_Comm(){ pyORBIT_MPI_Comm* pyMPI_Comm = PyObject_New(pyORBIT_MPI_Comm,&pyORBIT_MPI_Comm_Type); pyMPI_Comm->comm = MPI_COMM_WORLD; + Py_INCREF((PyObject *) pyMPI_Comm); return pyMPI_Comm; }