From 0fd8bf4b0fd4aa40cfffa9cfe0b8f7d9746c57b4 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sun, 14 Nov 2010 21:22:00 +0100 Subject: pattern_sim: Fix memory leaks --- src/diffraction-gpu.c | 3 +++ src/pattern_sim.c | 1 + 2 files changed, 4 insertions(+) diff --git a/src/diffraction-gpu.c b/src/diffraction-gpu.c index c76c4aa0..bbed9a9b 100644 --- a/src/diffraction-gpu.c +++ b/src/diffraction-gpu.c @@ -474,6 +474,9 @@ void cleanup_gpu(struct gpu_context *gctx) } } + free(gctx->sinc_luts); + free(gctx->sinc_lut_ptrs); + clReleaseCommandQueue(gctx->cq); clReleaseContext(gctx->ctx); free(gctx); diff --git a/src/pattern_sim.c b/src/pattern_sim.c index ae2a6943..4531c85b 100644 --- a/src/pattern_sim.c +++ b/src/pattern_sim.c @@ -456,6 +456,7 @@ int main(int argc, char *argv[]) find_projected_peaks(&image, cell, 0, 0.1); output_intensities(&image, cell, NULL, 0, 1, 0, stdout, 0, 0.1); + free(image.cpeaks); } if ( powder_fn != NULL ) { -- cgit v1.2.3