aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-02-09 23:04:44 -0800
committerThomas White <taw@physics.org>2013-02-09 23:04:56 -0800
commit55fdffb8a4f92b9b2d1c3c067b43119ce394b5db (patch)
tree6c85a4e1c9c84f05d6cd522c0e8cee3ee1ed78b8
parent00d4c6ce684b1352d585a287f8ef31c1c30a7c35 (diff)
Add cleanup functions for DirAx and MOSFLM
-rw-r--r--libcrystfel/src/dirax.c8
-rw-r--r--libcrystfel/src/dirax.h2
-rw-r--r--libcrystfel/src/index.c8
-rw-r--r--libcrystfel/src/mosflm.c8
-rw-r--r--libcrystfel/src/mosflm.h8
5 files changed, 29 insertions, 5 deletions
diff --git a/libcrystfel/src/dirax.c b/libcrystfel/src/dirax.c
index b7fc68ea..fc185fd4 100644
--- a/libcrystfel/src/dirax.c
+++ b/libcrystfel/src/dirax.c
@@ -650,3 +650,11 @@ IndexingPrivate *dirax_prepare(IndexingMethod indm, UnitCell *cell,
return (IndexingPrivate *)dp;
}
+
+
+void dirax_cleanup(IndexingPrivate *pp)
+{
+ struct dirax_private *p;
+ p = (struct dirax_private *)pp;
+ free(p);
+}
diff --git a/libcrystfel/src/dirax.h b/libcrystfel/src/dirax.h
index 09a794b0..9e746a1b 100644
--- a/libcrystfel/src/dirax.h
+++ b/libcrystfel/src/dirax.h
@@ -42,4 +42,6 @@ extern IndexingPrivate *dirax_prepare(IndexingMethod indm,
struct detector *det,
struct beam_params *beam, float *ltl);
+extern void dirax_cleanup(IndexingPrivate *pp);
+
#endif /* DIRAX_H */
diff --git a/libcrystfel/src/index.c b/libcrystfel/src/index.c
index cb3639e4..28f33388 100644
--- a/libcrystfel/src/index.c
+++ b/libcrystfel/src/index.c
@@ -109,10 +109,14 @@ void cleanup_indexing(IndexingMethod *indms, IndexingPrivate **privs)
switch ( indms[n] & INDEXING_METHOD_MASK ) {
case INDEXING_NONE :
+ break;
+
case INDEXING_DIRAX :
+ dirax_cleanup(privs[n]);
+ break;
+
case INDEXING_MOSFLM :
- /* No cleanup */
- /* FIXME: Not true */
+ mosflm_cleanup(privs[n]);
break;
case INDEXING_REAX :
diff --git a/libcrystfel/src/mosflm.c b/libcrystfel/src/mosflm.c
index f4f45d40..7c3a12b4 100644
--- a/libcrystfel/src/mosflm.c
+++ b/libcrystfel/src/mosflm.c
@@ -753,3 +753,11 @@ IndexingPrivate *mosflm_prepare(IndexingMethod indm, UnitCell *cell,
return (IndexingPrivate *)mp;
}
+
+
+void mosflm_cleanup(IndexingPrivate *pp)
+{
+ struct mosflm_private *p;
+ p = (struct mosflm_private *)pp;
+ free(p);
+}
diff --git a/libcrystfel/src/mosflm.h b/libcrystfel/src/mosflm.h
index 65aeb631..4bb26afc 100644
--- a/libcrystfel/src/mosflm.h
+++ b/libcrystfel/src/mosflm.h
@@ -3,13 +3,13 @@
*
* Invoke the DPS auto-indexing algorithm through MOSFLM
*
- * Copyright © 2012 Deutsches Elektronen-Synchrotron DESY,
- * a research centre of the Helmholtz Association.
+ * Copyright © 2012-2013 Deutsches Elektronen-Synchrotron DESY,
+ * a research centre of the Helmholtz Association.
* Copyright © 2012 Richard Kirian
*
* Authors:
* 2010 Richard Kirian <rkirian@asu.edu>
- * 2012 Thomas White <taw@physics.org>
+ * 2012-2013 Thomas White <taw@physics.org>
*
* This file is part of CrystFEL.
*
@@ -45,4 +45,6 @@ extern IndexingPrivate *mosflm_prepare(IndexingMethod indm, UnitCell *cell,
struct detector *det,
struct beam_params *beam, float *ltl);
+extern void mosflm_cleanup(IndexingPrivate *pp);
+
#endif /* MOSFLM_H */