From 160ff6d0204f050147bc855977ff7c19c71a5acb Mon Sep 17 00:00:00 2001 From: Helen Ginn Date: Wed, 18 Jan 2017 16:01:25 +0000 Subject: One image has no more leaks from taketwo.c --- libcrystfel/src/taketwo.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/libcrystfel/src/taketwo.c b/libcrystfel/src/taketwo.c index 129cdb4b..4b74adbb 100644 --- a/libcrystfel/src/taketwo.c +++ b/libcrystfel/src/taketwo.c @@ -536,6 +536,7 @@ static signed int finalise_solution(gsl_matrix *rot, struct SpotVec *obs_vecs, gsl_matrix **rotations = malloc(sizeof(*rotations)* pow(member_num, 2) - member_num); int i, j, count; + for ( i=0; i<1; i++ ) { for ( j=0; j max_max_members) { max_max_members = max_members; gsl_matrix_free(best_rotation); best_rotation = *rotation; + *rotation = NULL; } else { gsl_matrix_free(*rotation); *rotation = NULL; @@ -843,18 +851,20 @@ static int find_seed(struct SpotVec *obs_vecs, int obs_vec_count, if (seconds > 30) { /* Heading towards CrystFEL cutoff so return your best guess and run */ - free(i_idx); free(j_idx); + *rotation = best_rotation; - return (best_rotation != NULL); + STATUS("Return timeout\n"); + return (best_rotation != NULL); } } - free(i_idx); i_idx = NULL; - free(j_idx); j_idx = NULL; + free(i_idx); + free(j_idx); } } /* yes this } is meant to be here */ + STATUS("Return exhaustion\n"); *rotation = best_rotation; return (best_rotation != NULL); } @@ -1097,7 +1107,7 @@ static UnitCell *run_taketwo(UnitCell *cell, struct rvec *rlps, int rlp_count) } result = transform_cell_gsl(cell, solution); - + gsl_matrix_free(solution); cleanup_taketwo_obs_vecs(obs_vecs, obs_vec_count); return result; -- cgit v1.2.3