From 06461a6c1e0a72af2fb8a63f76f15547d5367924 Mon Sep 17 00:00:00 2001 From: Kenneth Beyerlein Date: Thu, 16 Jan 2014 15:40:52 +0100 Subject: Made free_rigid_groups function and call in free_detector_geometry --- libcrystfel/src/detector.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libcrystfel/src') diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c index 174abefe..cc165a3e 100644 --- a/libcrystfel/src/detector.c +++ b/libcrystfel/src/detector.c @@ -588,6 +588,18 @@ static void add_to_rigid_group(struct rigid_group *rg, struct panel *p) rg->panels[rg->n_panels++] = p; } +static void rigid_groups_free (struct detector *det) +{ + int i; + if ( det->rigid_groups == NULL) return; + for ( i = 0; i < det->n_rigid_groups; i++ ){ + free( det->rigid_groups[i]->name ); + free( det->rigid_groups[i]->panels ); + free( det->rigid_groups[i] ); + } + free(det->rigid_groups); +} + static void fix_up_rigid_groups(struct detector *det) { @@ -1068,7 +1080,7 @@ void free_detector_geometry(struct detector *det) { int i; - free(det->rigid_groups); + rigid_groups_free(det); for ( i=0; in_panels; i++ ) { free(det->panels[i].clen_from); -- cgit v1.2.3