瀏覽代碼

mpi/src: clean internal_req objects

Nathalie Furmento 10 年之前
父節點
當前提交
2993546e16
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      mpi/src/starpu_mpi.c

+ 8 - 0
mpi/src/starpu_mpi.c

@@ -615,6 +615,10 @@ int starpu_mpi_wait(starpu_mpi_req *public_req, MPI_Status *status)
 
 	/* The internal request structure was automatically allocated */
 	*public_req = NULL;
+	if (req->internal_req)
+	{
+		free(req->internal_req); req->internal_req = NULL;
+	}
 	free(req);
 
 	free(waiting_req);
@@ -704,6 +708,10 @@ int starpu_mpi_test(starpu_mpi_req *public_req, int *flag, MPI_Status *status)
 			 * request structure which was automatically allocated
 			 * */
 			*public_req = NULL;
+			if (req->internal_req)
+			{
+				free(req->internal_req); req->internal_req = NULL;
+			}
 			free(req);
 		}