diff options
author | Thomas White <taw@bitwiz.org.uk> | 2011-01-26 16:24:22 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:27:12 +0100 |
commit | eb24fd94de4e5d59b691acf0b1bfd43de64d66c1 (patch) | |
tree | 8c3dc62a0e759859e05f61e25abb0b64ea7af6b6 /src/index.c | |
parent | 81754383c40d69ec65dbd5d013d6fff25d094a3c (diff) |
Don't try later cells and algorithms if successful
Also fix a memory leak
Diffstat (limited to 'src/index.c')
-rw-r--r-- | src/index.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/index.c b/src/index.c index eef85d52..ce6021da 100644 --- a/src/index.c +++ b/src/index.c @@ -210,14 +210,20 @@ void index_pattern(struct image *image, UnitCell *cell, IndexingMethod *indm, } image->indexed_cell = new_cell; + goto done; /* Success */ } + for ( i=0; i<image->ncells; i++ ) { + cell_free(image->candidate_cells[i]); + } + /* Move on to the next indexing method */ n++; } +done: for ( i=0; i<image->ncells; i++ ) { cell_free(image->candidate_cells[i]); } |