From 55fdffb8a4f92b9b2d1c3c067b43119ce394b5db Mon Sep 17 00:00:00 2001 From: Thomas White Date: Sat, 9 Feb 2013 23:04:44 -0800 Subject: Add cleanup functions for DirAx and MOSFLM --- libcrystfel/src/dirax.c | 8 ++++++++ libcrystfel/src/dirax.h | 2 ++ libcrystfel/src/index.c | 8 ++++++-- libcrystfel/src/mosflm.c | 8 ++++++++ libcrystfel/src/mosflm.h | 8 +++++--- 5 files changed, 29 insertions(+), 5 deletions(-) (limited to 'libcrystfel') 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 - * 2012 Thomas White + * 2012-2013 Thomas White * * 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 */ -- cgit v1.2.3