From 49ae24384b483e40a6f1ad266ee0828c8f5c5a04 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 2 Mar 2020 16:19:26 +0100 Subject: image_free(): Free more stuff --- libcrystfel/src/image.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'libcrystfel') diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c index cd461183..b0f23871 100644 --- a/libcrystfel/src/image.c +++ b/libcrystfel/src/image.c @@ -1794,10 +1794,31 @@ struct image *image_read(DataTemplate *dtempl, const char *filename, void image_free(struct image *image) { + int i, np; + if ( image == NULL ) return; image_feature_list_free(image->features); free_all_crystals(image); free(image->filename); free(image->ev); + + if ( image->detgeom != NULL ) { + np = image->detgeom->n_panels; + } else if ( image->det != NULL ) { + np = image->det->n_panels; + } else { + np = 0; + } + + for ( i=0; idp[i]); + free(image->sat[i]); + free(image->bad[i]); + } + + free(image->dp); + free(image->sat); + free(image->bad); + free(image); } -- cgit v1.2.3