aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src/detgeom.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-06-02 13:04:53 +0200
committerThomas White <taw@physics.org>2020-07-29 18:42:57 +0200
commita851516f08edab1f54592b4e6df5ff87d3c6dfd5 (patch)
tree3e5f9f8c1bb10128fc8cbc87e1491812e5e63806 /libcrystfel/src/detgeom.c
parent5b1793068fdb55d5197165f988e72faa7bc98206 (diff)
Add detgeom_free
Diffstat (limited to 'libcrystfel/src/detgeom.c')
-rw-r--r--libcrystfel/src/detgeom.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libcrystfel/src/detgeom.c b/libcrystfel/src/detgeom.c
index 18fbd220..7633ca54 100644
--- a/libcrystfel/src/detgeom.c
+++ b/libcrystfel/src/detgeom.c
@@ -31,6 +31,7 @@
#endif
#include <math.h>
+#include <stdlib.h>
#include "detgeom.h"
@@ -62,3 +63,16 @@ void detgeom_transform_coords(struct detgeom_panel *p,
r[1] = sin(twotheta)*sin(az) / wavelength;
r[2] = (ctt - 1.0) / wavelength;
}
+
+
+void detgeom_free(struct detgeom *detgeom)
+{
+ int i;
+
+ for ( i=0; i<detgeom->n_panels; i++ ) {
+ free(detgeom->panels[i].name);
+ }
+
+ free(detgeom->panels);
+ free(detgeom);
+}