diff options
author | Thomas White <taw@physics.org> | 2020-03-02 16:19:26 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2020-07-29 18:42:24 +0200 |
commit | 49ae24384b483e40a6f1ad266ee0828c8f5c5a04 (patch) | |
tree | 2644730c8cfc20ac816ac380d022116aa4cb9662 /libcrystfel | |
parent | 9cf09264ace112c16924ccd09b43fe26bf737c48 (diff) |
image_free(): Free more stuff
Diffstat (limited to 'libcrystfel')
-rw-r--r-- | libcrystfel/src/image.c | 21 |
1 files changed, 21 insertions, 0 deletions
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; i<np; i++ ) { + free(image->dp[i]); + free(image->sat[i]); + free(image->bad[i]); + } + + free(image->dp); + free(image->sat); + free(image->bad); + free(image); } |