summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerdia <fsherry@users.noreply.github.com>2020-09-11 23:04:55 +0200
committerGitHub <noreply@github.com>2020-09-11 23:04:55 +0200
commit14c4348892de6621f0248d888de58dd614bda8c9 (patch)
treef3f17316d6e51b81bcdb97d4986f58dcd7921ffa
parentb1f9c6051205f4c4b03486e16d4697787865bf36 (diff)
downloadastra-14c4348892de6621f0248d888de58dd614bda8c9.tar.gz
astra-14c4348892de6621f0248d888de58dd614bda8c9.tar.bz2
astra-14c4348892de6621f0248d888de58dd614bda8c9.tar.xz
astra-14c4348892de6621f0248d888de58dd614bda8c9.zip
Fix memory leak in CUDA 2D par_fp
Arrays were dynamically allocated in the function convertAndUploadAngles, but were not deallocated, resulting in a memory leak. At the end of this function I now delete [] these arrays, fixing the memory leak.
-rw-r--r--cuda/2d/par_fp.cu4
1 files changed, 4 insertions, 0 deletions
diff --git a/cuda/2d/par_fp.cu b/cuda/2d/par_fp.cu
index ea436c3..aac6cc3 100644
--- a/cuda/2d/par_fp.cu
+++ b/cuda/2d/par_fp.cu
@@ -251,6 +251,10 @@ static void convertAndUploadAngles(const SParProjection *projs, unsigned int nth
cudaMemcpyToSymbol(gC_angle, angles, nth*sizeof(float), 0, cudaMemcpyHostToDevice);
cudaMemcpyToSymbol(gC_angle_offset, offsets, nth*sizeof(float), 0, cudaMemcpyHostToDevice);
cudaMemcpyToSymbol(gC_angle_detsize, detsizes, nth*sizeof(float), 0, cudaMemcpyHostToDevice);
+
+ delete [] angles;
+ delete [] offsets;
+ delete [] detsizes;
}