diff options
Diffstat (limited to 'libcrystfel/src')
-rw-r--r-- | libcrystfel/src/image.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c index 8fe3d69c..dcfd9b2a 100644 --- a/libcrystfel/src/image.c +++ b/libcrystfel/src/image.c @@ -182,8 +182,13 @@ void image_add_crystal(struct image *image, Crystal *cryst) void free_all_crystals(struct image *image) { int i; - + if ( image->crystals == NULL ) return; for ( i=0; i<image->n_crystals; i++ ) { + Crystal *cr= image->crystals[i]; + reflist_free(crystal_get_reflections(cr)); + cell_free(crystal_get_cell(cr)); crystal_free(image->crystals[i]); } + free(image->crystals); + image->n_crystals = 0; } |