From 233487cb155a6ad7a3f7443e6da90f3b08d2ff61 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 21 Jan 2014 11:12:55 +0100 Subject: Fussiness --- libcrystfel/src/detector.c | 23 +++++++++++++---------- libcrystfel/src/image.c | 10 ++++++---- 2 files changed, 19 insertions(+), 14 deletions(-) (limited to 'libcrystfel') diff --git a/libcrystfel/src/detector.c b/libcrystfel/src/detector.c index 2db7cfd2..a5dc12f7 100644 --- a/libcrystfel/src/detector.c +++ b/libcrystfel/src/detector.c @@ -3,12 +3,13 @@ * * Detector properties * - * Copyright © 2012 Deutsches Elektronen-Synchrotron DESY, - * a research centre of the Helmholtz Association. + * Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY, + * a research centre of the Helmholtz Association. * Copyright © 2012 Richard Kirian * * Authors: - * 2009-2012 Thomas White + * 2009-2014 Thomas White + * 2014 Kenneth Beyerlein * 2011 Andrew Aquila * 2011 Richard Kirian * @@ -588,14 +589,16 @@ 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) + +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] ); + + if ( det->rigid_groups == NULL ) return; + for ( i=0; in_rigid_groups; i++ ) { + free(det->rigid_groups[i]->name); + free(det->rigid_groups[i]->panels); + free(det->rigid_groups[i]); } free(det->rigid_groups); } @@ -1082,7 +1085,7 @@ void free_detector_geometry(struct detector *det) rigid_groups_free(det); - free( det->defaults.clen_from ); + free(det->defaults.clen_from); for ( i=0; in_panels; i++ ) { free(det->panels[i].clen_from); diff --git a/libcrystfel/src/image.c b/libcrystfel/src/image.c index dcfd9b2a..f4a3384f 100644 --- a/libcrystfel/src/image.c +++ b/libcrystfel/src/image.c @@ -3,11 +3,12 @@ * * Handle images and image features * - * Copyright © 2012 Deutsches Elektronen-Synchrotron DESY, - * a research centre of the Helmholtz Association. + * Copyright © 2012-2014 Deutsches Elektronen-Synchrotron DESY, + * a research centre of the Helmholtz Association. * * Authors: - * 2011-2012 Thomas White + * 2011-2014 Thomas White + * 2014 Kenneth Beyerlein * * This file is part of CrystFEL. * @@ -179,12 +180,13 @@ void image_add_crystal(struct image *image, Crystal *cryst) } +/* Free all crystals, including their RefLists and UnitCells */ void free_all_crystals(struct image *image) { int i; if ( image->crystals == NULL ) return; for ( i=0; in_crystals; i++ ) { - Crystal *cr= image->crystals[i]; + Crystal *cr = image->crystals[i]; reflist_free(crystal_get_reflections(cr)); cell_free(crystal_get_cell(cr)); crystal_free(image->crystals[i]); -- cgit v1.2.3