aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Beyerlein <kenneth.beyerlein@desy.de>2014-01-16 15:40:52 +0100
committerThomas White <taw@physics.org>2014-01-21 11:08:17 +0100
commit06461a6c1e0a72af2fb8a63f76f15547d5367924 (patch)
tree2957b0cdff18e7ae139fb2047443ebe3117ca679
parent4e4226537817119af4a8a59ebaa7294f041652dc (diff)
Made free_rigid_groups function and call in free_detector_geometry
-rw-r--r--libcrystfel/src/detector.c14
1 files changed, 13 insertions, 1 deletions
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; i<det->n_panels; i++ ) {
free(det->panels[i].clen_from);