From 59b73103187c04ad63d90d65ef67f3a9fe19d00e Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 5 Feb 2020 14:12:38 +0100 Subject: Fix memory leaks in 3D BP --- cuda/3d/cone_bp.cu | 2 ++ cuda/3d/par3d_bp.cu | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'cuda') diff --git a/cuda/3d/cone_bp.cu b/cuda/3d/cone_bp.cu index 7312bbc..df1e19f 100644 --- a/cuda/3d/cone_bp.cu +++ b/cuda/3d/cone_bp.cu @@ -303,6 +303,8 @@ bool transferConstants(const SConeProjection* angles, unsigned int iProjAngles, // TODO: Check for errors cudaMemcpyToSymbol(gC_C, p, iProjAngles*sizeof(DevConeParams), 0, cudaMemcpyHostToDevice); + delete[] p; + return true; } diff --git a/cuda/3d/par3d_bp.cu b/cuda/3d/par3d_bp.cu index 602f209..32a2062 100644 --- a/cuda/3d/par3d_bp.cu +++ b/cuda/3d/par3d_bp.cu @@ -247,6 +247,10 @@ bool transferConstants(const SPar3DProjection* angles, unsigned int iProjAngles, cudaMemcpyToSymbol(gC_C, p, iProjAngles*sizeof(DevPar3DParams), 0, cudaMemcpyHostToDevice); cudaMemcpyToSymbol(gC_scale, s, iProjAngles*sizeof(float), 0, cudaMemcpyHostToDevice); + + delete[] p; + delete[] s; + return true; } -- cgit v1.2.3